tarrasch
tarrasch

Reputation: 2680

How can i specify the format for xticks/xlabel on a plot

when setting up a plot for matplotlib, i run into very large numbers.

in one plot, these get converted into the scientific format, which i like, in another one they don't get converted. How can i specify this behaviour?

example where it works as i like it: enter image description here

example where it does not work as i want it: enter image description here

i am using matplotlib version 0.99.1.1.

Upvotes: 1

Views: 1909

Answers (1)

FakeDIY
FakeDIY

Reputation: 1445

Use plt.ticklabel_format :

For example:

plt.ticklabel_format(style='sci',axis='x',scilimits=(0,0))

Upvotes: 4

Related Questions