You have a plot with scientific notation and an offset on the axes, and you want to eliminate them.
The offset is separate from scientific notation and is added to the numbers displayed on the axis. To disable it, use:
plt.ticklabel_format(useOffset=False)
To prevent scientific notation, use:
plt.ticklabel_format(style='plain')
To disable both the offset and scientific notation, use:
plt.ticklabel_format(useOffset=False,>
Suppose you have the following code:
import matplotlib.pyplot as plt plt.plot(range(2003, 2012, 1), range(200300, 201200, 100)) plt.ticklabel_format(useOffset=False) plt.show()
Which produces this plot:
[Image of plot]
By applying the correct settings, you can eliminate both the offset and scientific notation:
import matplotlib.pyplot as plt plt.plot(range(2003, 2012, 1), range(200300, 201200, 100)) plt.ticklabel_format(useOffset=False,>
Resulting in this plot:
[Image of plot without scientific notation and offset]
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3