@@ -45,17 +45,18 @@ def figure_edit(axes, parent=None):
45
45
sep = (None , None ) # separator
46
46
47
47
# Get / General
48
- xmin , xmax = map (float , axes .get_xlim ())
49
- ymin , ymax = map (float , axes .get_ylim ())
48
+ # Cast to builtin floats as they have nicer reprs.
49
+ orig_xmin , orig_xmax = map (float , axes .get_xlim ())
50
+ orig_ymin , orig_ymax = map (float , axes .get_ylim ())
50
51
general = [('Title' , axes .get_title ()),
51
52
sep ,
52
53
(None , "<b>X-Axis</b>" ),
53
- ('Min' , xmin ), ('Max' , xmax ),
54
+ ('Min' , orig_xmin ), ('Max' , orig_xmax ),
54
55
('Label' , axes .get_xlabel ()),
55
56
('Scale' , [axes .get_xscale (), 'linear' , 'log' ]),
56
57
sep ,
57
58
(None , "<b>Y-Axis</b>" ),
58
- ('Min' , ymin ), ('Max' , ymax ),
59
+ ('Min' , orig_ymin ), ('Max' , orig_ymax ),
59
60
('Label' , axes .get_ylabel ()),
60
61
('Scale' , [axes .get_yscale (), 'linear' , 'log' ]),
61
62
sep ,
@@ -234,7 +235,9 @@ def apply_callback(data):
234
235
# Redraw
235
236
figure = axes .get_figure ()
236
237
figure .canvas .draw ()
237
- figure .canvas .toolbar .push_current ()
238
+ if not ((xmin , xmax ) == (orig_xmin , orig_xmax )
239
+ and (ymin , ymax ) == (orig_ymin , orig_ymax )):
240
+ figure .canvas .toolbar .push_current ()
238
241
239
242
data = formlayout .fedit (datalist , title = "Figure options" , parent = parent ,
240
243
icon = get_icon ('qt4_editor_options.svg' ),
0 commit comments