8
문서를 읽었지만 여전히 줄에 레이블을 지정하지 못했습니다.matplotlib (파이썬)에서 라인의 라벨을 지정하는 방법은 무엇입니까?
plt.plot([min(np.array(positions)[:,0]), max(np.array(positions)[:,0])], [0,0], color='k', label='East') # West-East
plt.plot([0,0], [min(np.array(positions)[:,1]), max(np.array(positions)[:,1])], color='k', label='North') # South-North
위의 코드 조각에서 북쪽 방향과 동쪽 방향을 플롯하려고합니다.
position
에는 플롯 할 점이 들어 있습니다.
그러나 다음과 같이 나는 NO 라벨 2 개 직선으로 끝낼 :
가 잘못 어디?
내가 아는 한 레이블 인수는 범례입니다. http://matplotlib.org/users/annotations_intro.html - plt.legend()에 주석을 달아 보면 라벨이 나타납니다. – shaunakde