저는 matplotlib을 사용하여 화살표가있는 주석을 만듭니다. 동일한 머리 길이의 파이썬 주석 화살표
from matplotlib import pyplot as plt
plt.figure()
plt.annotate('Text1', xy=(1, 0), xytext=(1, 1), arrowprops=dict(alpha=0.5, fc='r', ec='r', headwidth=10))
plt.annotate('Text2', xy=(3, 0), xytext=(3, 3), arrowprops=dict(alpha=0.5, fc='r', ec='r', headwidth=10))
plt.annotate('Text3', xy=(6, 0), xytext=(6, 6), arrowprops=dict(alpha=0.5, fc='r', ec='r', headwidth=10))
plt.annotate('Text4', xy=(9, 0), xytext=(9, 9), arrowprops=dict(alpha=0.5, fc='r', ec='r', headwidth=10))
plt.xlim((0, 10))
plt.ylim(0, 10)
plt.show()
알 수있는 바와 같이
는, 화살표 머리의 길이가 라인의 길이에 의해 영향을 화살표 사이에서 변화된다.다른 선 길이이지만 같은 화살촉 길이의 화살표를 만드는 방법을 찾고 있습니다. 많은 옵션이 주석 매뉴얼 페이지에 나열되어 있지만 원하는 결과를 얻을 수 없었습니다.
대체 접근법으로 나는 plt.arrow을 사용하여 화살표를 플로팅하려했습니다. 이 경우 화살표 머리는 원하는대로 보였지만 투명도를 사용하면 추가 선이 보입니다.
최고, 안부에서 zinjaai