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 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.
  • Loading branch information
tacaswell committed Apr 8, 2016
1 parent 0423430 commit eed7e69
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/matplotlib/backends/qt_editor/figureoptions.py
Expand Up @@ -164,8 +164,10 @@ 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 eed7e69

Please sign in to comment.