@@ -63,6 +63,12 @@ def figure_edit(axes, parent=None):
63
63
('(Re-)Generate automatic legend' , False ),
64
64
]
65
65
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
+
66
72
if has_curve :
67
73
# Get / Curves
68
74
linedict = {}
@@ -101,7 +107,7 @@ def figure_edit(axes, parent=None):
101
107
has_curve = bool (curves )
102
108
103
109
datalist = [(general , "Axes" , "" )]
104
- if has_curve :
110
+ if has_curve and curves :
105
111
datalist .append ((curves , "Curves" , "" ))
106
112
107
113
def apply_callback (data ):
@@ -122,6 +128,14 @@ def apply_callback(data):
122
128
axes .set_ylim (ymin , ymax )
123
129
axes .set_ylabel (ylabel )
124
130
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
+
125
139
if has_curve :
126
140
# Set / Curves
127
141
for index , curve in enumerate (curves ):
0 commit comments