Skip to content

Commit

Permalink
FIX: do not always reset scales from igureoptions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tacaswell committed Apr 8, 2016
1 parent 44e7356 commit fd799a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/matplotlib/backends/qt_editor/figureoptions.py
Expand Up @@ -120,8 +120,12 @@ def apply_callback(data):
# Set / General
title, xmin, xmax, xlabel, xscale, ymin, ymax, ylabel, yscale, \
generate_legend = general
axes.set_xscale(xscale)
axes.set_yscale(yscale)

if axes.get_xscale() != xscale:
axes.set_xscale(xscale)
if axes.get_yscale() != yscale:
axes.set_yscale(yscale)

axes.set_title(title)
axes.set_xlim(xmin, xmax)
axes.set_xlabel(xlabel)
Expand Down

0 comments on commit fd799a8

Please sign in to comment.