File tree Expand file tree Collapse file tree
lib/matplotlib/backends/qt_editor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ def figure_edit(axes, parent=None):
6363 ('(Re-)Generate automatic legend' , False ),
6464 ]
6565
66+ # Save the unit data
67+ xconverter = axes .xaxis .converter
68+ yconverter = axes .yaxis .converter
69+ xunits = axes .xaxis .get_units ()
70+ yunits = axes .yaxis .get_units ()
71+
6672 if has_curve :
6773 # Get / Curves
6874 linedict = {}
@@ -122,6 +128,14 @@ def apply_callback(data):
122128 axes .set_ylim (ymin , ymax )
123129 axes .set_ylabel (ylabel )
124130
131+ # Restore the unit data
132+ axes .xaxis .converter = xconverter
133+ axes .yaxis .converter = yconverter
134+ axes .xaxis .set_units (xunits )
135+ axes .yaxis .set_units (yunits )
136+ axes .xaxis ._update_axisinfo ()
137+ axes .yaxis ._update_axisinfo ()
138+
125139 if has_curve :
126140 # Set / Curves
127141 for index , curve in enumerate (curves ):
You can’t perform that action at this time.
0 commit comments