Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6e21419

Browse filesBrowse files
committed
Save converter before any changes and reset
1 parent a505dee commit 6e21419
Copy full SHA for 6e21419

File tree

1 file changed

+6
-2
lines changed
Filter options

1 file changed

+6
-2
lines changed

‎lib/matplotlib/backends/qt_editor/figureoptions.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/qt_editor/figureoptions.py
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ def convert_limits(lim, converter):
4040
return map(float, lim)
4141

4242
axis_map = axes._axis_map
43+
axis_converter = {
44+
name: axis.converter
45+
for name, axis in axis_map.items()
46+
}
4347
axis_limits = {
4448
name: tuple(convert_limits(
4549
getattr(axes, f'get_{name}lim')(), axis.converter
@@ -197,7 +201,7 @@ def apply_callback(data):
197201

198202
getattr(axes, f"set_{name}lim")(axis_min, axis_max)
199203
axis.set_label_text(axis_label)
200-
setattr(axis, 'converter', axis.converter)
204+
axis.converter = axis_converter[name]
201205
axis.set_units(axis_units[name])
202206
axis._update_axisinfo()
203207

@@ -246,7 +250,7 @@ def apply_callback(data):
246250
# Redraw
247251
figure = axes.get_figure()
248252
figure.canvas.draw()
249-
for name in axis_map.keys():
253+
for name in axis_map:
250254
if getattr(axes, f"get_{name}lim")() != orig_limits[name]:
251255
figure.canvas.toolbar.push_current()
252256
break

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.