I am having an issue with the format of the tick labels of an axis. I disabled the offset from the y_axis:
ax1.ticklabel_format(style = 'sci', useOffset=False)
and tried to put it a scientific format but all I get is:
0.00355872
but I expected something like:
3.55872...E-2
or similar.
what I really want is something like:
3.55872... (on the tick label) x 10^2 (or something similar - on the axis label)
I could try to set the labels as static,, but in the end I will have a few tens or hundreds of plots with different values, so it needs to be set dynamically.
An alternative would be to place the y_axis offset as the label, but I also have no clue on how to do this.
To set labels on the x-axis and y-axis, use the plt. xlabel() and plt. ylabel() methods.
(m, n), pair of integers; if style is 'sci', scientific notation will be used for numbers outside the range 10m to 10n. Use (0,0) to include all numbers. Use (m,m) where m <> 0 to fix the order of magnitude to 10m.
You should also specify axis and threshold limits:
ax1.ticklabel_format(axis='y', style='sci', scilimits=(-2,2))
This would use sci format on y axis when figures are out of the [0.01, 99]
bounds.
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