-1

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:

Graph with exponential values

Mr. T
  • 11,960
  • 10
  • 32
  • 54
M1k
  • 5
  • 2

2 Answers2

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.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Jonny_92
  • 42
  • 9
  • 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