I have the following snippit of code:
data.plot(y='Close', ax = ax)
newdates = exceptthursday.loc[start:end]
for anotate in (newdates.index + BDay()).strftime('%Y-%m-%d'):
ax.annotate('holliday', xy=(anotate, data['Close'].loc[anotate]), xycoords='data',
xytext=(-30, 40), textcoords='offset points',
size=13, ha='center', va="baseline",
bbox=dict(boxstyle="round", alpha=0.1),
arrowprops=dict(arrowstyle="wedge,tail_width=0.5", alpha=0.1));
This produces a plot which looks like this:
As you can see i have explicitly mentioned the xytext
, this makes the "bubbles" messy as at some locations they overlap which makes it hard to read. Is there any way it can be "auto - placed" so that they are not overlapping. Such as some of the "bubbles" are above and below the plot line in such a way that they do not overlap.