Skip to content

Commit d6958f8

Browse files
committed
fix lint
1 parent bb20d36 commit d6958f8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

matplotlib2tikz/patch.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,21 @@ def _draw_rectangle(data, obj, draw_options):
6363

6464
# get real label, bar charts by default only give rectangles
6565
# labels of "_nolegend_"
66-
# See http://stackoverflow.com/questions/35881290/how-to-get-the-label-on-bar-plot-stacked-bar-plot-in-matplotlib
67-
handles,labels = obj.axes.get_legend_handles_labels()
68-
labelsFound = [label for h,label in zip(handles, labels) if obj in h.get_children()]
66+
# See
67+
# <http://stackoverflow.com/questions/35881290/how-to-get-the-label-on-bar-plot-stacked-bar-plot-in-matplotlib>
68+
handles, labels = obj.axes.get_legend_handles_labels()
69+
labelsFound = [
70+
label for h, label in zip(handles, labels) if obj in h.get_children()
71+
]
6972
if len(labelsFound) == 1:
7073
label = labelsFound[0]
7174

7275
legend = ''
7376
if label != '_nolegend_' and label not in data['rectangle_legends']:
7477
data['rectangle_legends'].add(label)
75-
legend = ('\\addlegendimage{ybar,ybar legend,%s};\n'
76-
) % (','.join(draw_options))
78+
legend = (
79+
'\\addlegendimage{ybar,ybar legend,%s};\n'
80+
) % (','.join(draw_options))
7781

7882
left_lower_x = obj.get_x()
7983
left_lower_y = obj.get_y()

0 commit comments

Comments
 (0)