I am using Python and Pyplot to produce a plot. The y axis of the plot is generated automatically, and works fine.
If the range is small however, the y axis will produce values such as:
0.00005,
0.00010,
0.00015,
0.00020,
0.00025,
0.00030,
and then at the top of the axis, will say:
+1.543e-1
I would prefer that it just explicitly shows the values:
0.15435
0.15440
0.15445
0.15450
0.15455
0.15460
Could someone tell me how to do this please?
Alright, I think I found the total solution:
Here is a quick plot that recreates your problem:
plot((0.15435,0.15440,0.15445,0.15450,0.15455,0.15460),(0.15435,0.15440,0.15445,0.15450,0.15455,0.15460))
The following code (similar to how it was as shown here) should adjust the ticker like you want:
y_formatter = matplotlib.ticker.ScalarFormatter(useOffset=False)
gca().yaxis.set_major_formatter(y_formatter)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With