Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 609571e

Browse files
tacaswellJulian Mehne
authored andcommitted
STY : pep8 on legend example
1 parent 2131d3d commit 609571e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

examples/pylab_examples/legend_demo6.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
from matplotlib.legend_handler import HandlerTuple
33

44
fig, (ax1, ax2) = plt.subplots(2, 1)
5-
p1 = ax1.scatter([1],[5], c='r', marker='s', s=100)
6-
p2 = ax1.scatter([3],[2], c='b', marker='o', s=100)
5+
p1 = ax1.scatter([1], [5], c='r', marker='s', s=100)
6+
p2 = ax1.scatter([3], [2], c='b', marker='o', s=100)
77

8-
l = ax1.legend([(p1, p2)],['points'], scatterpoints=1,
8+
l = ax1.legend([(p1, p2)], ['points'], scatterpoints=1,
99
handler_map={tuple: HandlerTuple(ndivide=0)})
1010

11-
ind = [1,2,3]
11+
ind = [1, 2, 3]
1212
pos1 = [1, 3, 2]
1313
neg1 = [2, 1, 4]
14-
width=[0.5, 0.5, 0.5]
14+
width = [0.5, 0.5, 0.5]
1515

1616
rpos1 = ax2.bar(ind, pos1, width=0.5, color='k', label='+1')
1717
rneg1 = ax2.bar(ind, neg1, width=0.5, color='w', hatch='///', label='-1')
1818

19-
l = ax2.legend([(rpos1, rneg1)],['Test'],
19+
l = ax2.legend([(rpos1, rneg1)], ['Test'],
2020
handler_map={(rpos1, rneg1): HandlerTuple(ndivide=0, pad=0.)})
2121

2222
plt.show()

0 commit comments

Comments
 (0)