-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Ticklabel format not preserved after editing plot limits #6276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It is the |
tacaswell
added a commit
to tacaswell/matplotlib
that referenced
this issue
Apr 8, 2016
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.
I think this might be relevant. plt.plot(1, 10000, 2, 20000, 'ro')
ax = plt.gca()
ax.yaxis.set_major_formatter(mpl.ticker.ScalarFormatter(useMathText=True))
ax.ticklabel_format(scilimits=(-3, 3)) # put after 'set_major_formatter', scilimits works
plt.show() works fine. But if plot(1, 10000, 2, 20000, 'ro')
ax = gca()
ax.ticklabel_format(scilimits=(-3, 3)) #put before 'set_major_formatter', scilimits doesn't work.
ax.yaxis.set_major_formatter(mpl.ticker.ScalarFormatter(useMathText=True))
plt.show() |
tacaswell
added a commit
to tacaswell/matplotlib
that referenced
this issue
May 22, 2016
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.
anntzer
pushed a commit
to anntzer/matplotlib
that referenced
this issue
Jul 24, 2016
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. Closes matplotlib#6281
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version: 1.5.1, Windows 7, using QT5 backend. Not tested on linux yet. After setting the format of an axis to use use scientific notation,
ticklabel_format(style='sci', axis='y', scilimits=(0,0))
changing the limits of the plot using the green checkbox widget in the NavigationToolbar will remove the scientific notation formatting that was just set. This would be a huge convenience for users who use scientific notation and want to work with plots interactively. Example:
The text was updated successfully, but these errors were encountered: