Tuesday, 13 August 2013

Is ticklabel_format broken?

Is ticklabel_format broken?

I am trying to plot a simple time series with years as units in the
x-axis. Unfortunately pyplot seems to think these numbers should be shown
in scientific format. I have seen suggestions on Stack Overflow to change
this behaviour with something like this:
plt.gca().ticklabel_format(style='plain', axis='x')
or even just
plt.ticklabel_format(style='plain', axis='x')
should be the way to go. To my surprise I noticed this does absolutely
nothing on my system. It has no effect, but does not trigger any errors
either. What's the deal here? I know that I can set the label strings
instead but clearly this is not how it's supposed to work. Since I
couldn't find any mention of this bug I wanted to check if this is a
common problem.
I'm running python 2.7 on Linux.

No comments:

Post a Comment