From fd799a83d3faee25379429b850607e4e01ae663b Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 8 Apr 2016 01:06:53 -0400 Subject: [PATCH] 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. --- lib/matplotlib/backends/qt_editor/figureoptions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/backends/qt_editor/figureoptions.py b/lib/matplotlib/backends/qt_editor/figureoptions.py index b1b850c9053c..218577993774 100644 --- a/lib/matplotlib/backends/qt_editor/figureoptions.py +++ b/lib/matplotlib/backends/qt_editor/figureoptions.py @@ -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)