Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80beedf commit 07930c0Copy full SHA for 07930c0
lib/matplotlib/backends/qt4_editor/figureoptions.py
@@ -127,10 +127,13 @@ def apply_callback(data):
127
128
# re-generate legend, if checkbox is checked. Stefan Kraus/tacaswell 2014-04-22
129
if generate_legend:
130
- old_legend = axes.get_legend()
131
- new_legend = axes.legend()
132
- new_legend._ncol = old_legend._ncol
133
- new_legend.draggable(old_legend._draggable is not None)
+ if axes.legend_ is not None:
+ old_legend = axes.get_legend()
+ new_legend = axes.legend(ncol = old_legend._ncol)
+ new_legend.draggable(old_legend._draggable is not None)
134
+ else:
135
+ new_legend = axes.legend()
136
+ new_legend.draggable(True)
137
138
# Redraw
139
figure = axes.get_figure()
0 commit comments