I want to make a bar plot with scientific notation on the y-axis.
However, when I use
plt.ticklabel_format(axis="y", style="scientific", scilimits=(0,0), useOffset = False, useMathText=True),
the height of my bar changes and thus are not true to the input parameters.
I really don't know why this is happening. Please see the two attached plots and code.
fig = plt.figure()
# with and without below line
plt.ticklabel_format(
axis="y",
style="scientific",
scilimits=(0,0),
useOffset = False,
useMathText=True,
)
plt.bar(x=x, height = height)
plt.xlabel('Load case no.')
plt.ylabel('Damage [-]')
plt.grid(axis="y",linestyle='--')
plt.draw()

