I want to use single annotation text to annotate several data points with several arrows. I made a simple workaround:
ax = plt.gca()
ax.plot([1,2,3,4],[1,4,2,6])
an1 = ax.annotate('Test',
xy=(2,4), xycoords='data',
xytext=(30,-80), textcoords='offset points',
arrowprops=dict(arrowstyle="-|>",
connectionstyle="arc3,rad=0.2",
fc="w"))
an2 = ax.annotate('Test',
xy=(3,2), xycoords='data',
xytext=(0,0), textcoords=an1,
arrowprops=dict(arrowstyle="-|>",
connectionstyle="arc3,rad=0.2",
fc="w"))
plt.show()
Producing following result:
But I don't really like this solution because it is... well, an ugly dirty hack.
Besides that, it affects the appearance of annotation (mainly if using semi-transparent bboxes etc).
So, if anyone got an actual solution or at least an idea how to implement it, please share.