remove scientific notation python matplotlib 1

remove scientific notation python matplotlib

fig, ax = plt.subplots()
ax.plot(range(2003,2012,1),range(200300,201200,100))
ax.ticklabel_format(style='plain') #This is the line you need <-------
plt.show()

Here is what the above code is Doing:
1. Create a figure and axis object
2. Plot the data
3. Set the tick labels to be plain text
4. Show the plot

The key line is #3.

The default setting for tick labels is to use scientific notation.

The line ax.ticklabel_format(style='plain') tells the axis object to use plain text for the tick labels.

This is the line you need to change the tick labels to plain text.

Similar Posts