So I've stumbled across a problem that I can't really understand how to solve. I've got my graph made, and my yaxis has numbers that reach milions. The problem is that i get exponential values (1e6) instead of the whole numbers. I'd like to see milions, instead of exponential values. This is the graph:
Asked
Active
Viewed 126 times
2 Answers
0
Thanks to @TheOldJonny I could figure it out, and what worked for me was this 2 lines of code:
ax = plt.gca()
ax.ticklabel_format(useOffset=False, style='plain')

M1k
- 5
- 2
-1
I have found this documentation inside the matplotlib site https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.ticklabel_format.html. I suppose you need to set the second attribute to plain
.
-
Thank you very much, it was indeed the plain attribute. I've tried 3 different methods and I thought it just couldn't be, you saved me on this one. Thank you again <3 – M1k May 17 '21 at 20:29