사람이 직접 실행할 수 있도록 구성된 데이터가 포함 된 자체 포함 예가 도움이됩니다. 다음은 귀하가 게시 한 내용에서 수정 된 자체 포함 된 예입니다. ipython -pylab
에 Matplotlib의 최신 svn 개정판이 나와 있습니다. 전설 관련 버그가 최근에 수정 된 것 같습니다.
자동 전설 기능과 관련된 버그를 가정
example figure http://www.iki.fi/jks/tmp/legend.png
, 당신은 당신이 원하는 일에 대해 명시 적으로 존재하여 해결할 수 있습니다
colors = (i + j for j in 'o<.' for i in 'bgrcmyk')
labels = 'one two three four five six seven eight nine ten'.split()
x = linspace(0, 2*pi, 3000)
d = (2+random((2,3000))) * c_[sin(x), cos(x)].T
for i, l, c in zip(range(10), labels, colors):
start, stop = i * 300, (i + 1) * 300
plot(d[0, start:stop], d[1, start:stop], c, label=l)
legend(loc='lower left')
show()
그리고 여기에 내가 무엇을 얻을 전설 :
colors = (i + j for j in 'o<.' for i in 'bgrcmyk')
labels = 'one two three four five six seven eight nine ten'.split()
x = linspace(0, 2*pi, 3000)
d = (2+random((2,3000))) * c_[sin(x), cos(x)].T
lg = []
for i, l, c in zip(range(10), labels, colors):
start, stop = i * 300, (i + 1) * 300
handle = plot(d[0, start:stop], d[1, start:stop], c, label=l)
lg.append(handle)
legend(lg, labels, loc='lower left')
show()
전설에 열거 된 항목이 10 개만 있어야한다는 것을 정확히 알고 있습니까? –
네, 맞습니다. – bayer