Skip to content

Commit fd799a8

Browse files
committed
FIX: do not always reset scales from igureoptions
Only try to set the axis scales if they have been changed. closes #6276 The `set_yscale` and `set_xscale` Axes methods call out to `Axis_set_scale` which resets the default locator/formatters (which makes sense when flipping between log/linear). Putting the cut-out in `figureoption` is the less disruptive change, even if the case could be made that the no-op short-circuit should be done in Axis or Axes.
1 parent 44e7356 commit fd799a8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,12 @@ def apply_callback(data):
120120
# Set / General
121121
title, xmin, xmax, xlabel, xscale, ymin, ymax, ylabel, yscale, \
122122
generate_legend = general
123-
axes.set_xscale(xscale)
124-
axes.set_yscale(yscale)
123+
124+
if axes.get_xscale() != xscale:
125+
axes.set_xscale(xscale)
126+
if axes.get_yscale() != yscale:
127+
axes.set_yscale(yscale)
128+
125129
axes.set_title(title)
126130
axes.set_xlim(xmin, xmax)
127131
axes.set_xlabel(xlabel)

0 commit comments

Comments
 (0)