単一の注釈テキストを使用して、複数の矢印で複数のデータ ポイントに注釈を付けたいと考えています。私は簡単な回避策を作りました:
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()
次の結果を生成します。
しかし、私はこのソリューションがあまり好きではありません。
それに加えて、注釈の外観に影響します (主に半透明の bbox を使用している場合など)。
したがって、誰かが実際の解決策または少なくともそれを実装する方法を知っている場合は、共有してください.