Skip to content

Commit 1c59f1e

Browse files
committed
fixed mistake
1 parent 50e2352 commit 1c59f1e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

matplotlibTUT/plt7_legend.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
plt.yticks([-2, -1.8, -1, 1.22, 3],
3131
[r'$really\ bad$', r'$bad$', r'$normal$', r'$good$', r'$really\ good$'])
3232

33-
l1, = plt.plot(x, y2, label='linear line')
34-
l2, = plt.plot(x, y1, color='red', linewidth=1.0, linestyle='--', label='square line')
33+
l1, = plt.plot(x, y1, label='linear line')
34+
l2, = plt.plot(x, y2, color='red', linewidth=1.0, linestyle='--', label='square line')
3535

36-
# plt.legend(loc='upper right')
37-
plt.legend(handles=[l1, l2], labels=['up', 'down'], loc='best')
36+
plt.legend(loc='upper right')
37+
# plt.legend(handles=[l1, l2], labels=['up', 'down'], loc='best')
3838
# the "," is very important in here l1, = plt... and l2, = plt... for this step
3939
"""legend( handles=(line1, line2, line3),
4040
labels=('label1', 'label2', 'label3'),

0 commit comments

Comments
 (0)