Skip to content

Commit eed7e69

Browse files
committed
FIX: do not always reset scales from igureoptions
Only try to set the axis scales if they have been changed. closes matplotlib#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 0423430 commit eed7e69

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,10 @@ def apply_callback(data):
164164
# Set / General
165165
(title, xmin, xmax, xlabel, xscale, ymin, ymax, ylabel, yscale,
166166
generate_legend) = general
167-
axes.set_xscale(xscale)
168-
axes.set_yscale(yscale)
167+
if axes.get_xscale() != xscale:
168+
axes.set_xscale(xscale)
169+
if axes.get_yscale() != yscale:
170+
axes.set_yscale(yscale)
169171
axes.set_title(title)
170172
axes.set_xlim(xmin, xmax)
171173
axes.set_xlabel(xlabel)

0 commit comments

Comments
 (0)