0

Trying to plot a small chart with matplotlib, the plot end up as following:

enter image description here

I.e. there is a number written (quite big, i put a red rectangle around it) at the top of the chart, that has to be added to the y axis ticks to give their correct value. For instance "0.5" on the y axis, in fact means 0.5+2.431e3, i.e. 2431.5.

Obviously I am not very fond of that notation...

How can I change it so the chart displays 2431, 2432 etc on the y axis ticks?

0

1 Answer 1

-1

You can use a ScalarFormatter to tell matplotlib not to use an offset:

from matplotlib.ticker import ScalarFormatter
formatter = ScalarFormatter(useOffset=False)
gca().yaxis.set_major_formatter(formatter)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.