Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ticklabel format not preserved after editing plot limits #6276

Closed
@peytondmurray

Description

@peytondmurray

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:

import matplotlib
matplotlib.use("Qt5Agg")
from numpy import *
from matplotlib.pyplot import *
from numpy.random import uniform

npts = 1000

x = uniform(-100, 100, npts)
y = 1000*sin(x)*cos(x**2)

plot(x, y)
ticklabel_format(style='sci', axis='both', scilimits=(0,0))

show()

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions