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

Skip to content

Commit 0bc4c52

Browse files
author
anykraus
committed
Re-Generate legend, through apply_callback/Apply
If there is a legend, it is re-generated when "Apply" is clicked. See Issue #2934: Might have side effects. #2934 tacaswell: "However this will clobber any legend that is not the auto-magically generated one so it should probably also get a tick box to enable/disable the updating of the legend." Tick box not included.
1 parent b8cb6c3 commit 0bc4c52

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/backends/qt4_editor/figureoptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ def apply_callback(data):
122122
line.set_markersize(markersize)
123123
line.set_markerfacecolor(markerfacecolor)
124124
line.set_markeredgecolor(markeredgecolor)
125+
126+
# re-generate legend, if there is one. Stefan Kraus/tacaswell 2014-04-02
127+
if axes.legend_ is not None:
128+
axes.legend()
125129

126130
# Redraw
127131
figure = axes.get_figure()

0 commit comments

Comments
 (0)