Why ticklabel_format has no effect in this matplotlib script?

17 hours ago 1
ARTICLE AD BOX

This Python 3.14.3 script with matplotlib 3.10.8:

import numpy as np, matplotlib.pyplot as plt a = np.random.rand(5)*3 b = np.random.rand(5)+1000 fig, ax = plt.subplots() ax.plot(a, 'r') ax.ticklabel_format(axis='y', style='plain') axx = ax.twinx() axx.plot(b, 'b') axx.ticklabel_format(axis='y', style='plain') plt.show()

produces a plot with scientific notation for Y-axis ticks, contrary to ticklabel_format with style='plain' documentation.

enter image description here

How to get the non-scientific notation for Y-axis ticks?

Read Entire Article