[Matplotlib-users] Formating unexpected number when autoscaling Y axis

Thomas Caswell tcaswell at gmail.com
Sat Jan 28 11:42:25 EST 2017


Please subscribe to the mailing list so you can post un-moderated (
https://mail.python.org/mailman/listinfo/matplotlib-users)

The default formatter identifies when the data is over a small range on a
large base and formats the ticks with an offset, see
http://matplotlib.org/api/ticker_api.html#default-formatter

The location is set by the internals of `Axis`, a quick glance at the code
suggests that manually tweaking the location may not be reliable.

You can get a reference to the text object via the `get_offset_text` method
on the `ax.xaxis` or `ax.yaxis` instances (
http://matplotlib.org/api/_as_gen/matplotlib.axis.Axis.get_offset_text.html#matplotlib.axis.Axis.get_offset_text)
to tweak the font properties.

Tom

On Sat, Jan 28, 2017 at 10:59 AM solisgbmpl <solisgb at gmail.com> wrote:

> I'm using matplotlib to get a large amount of plots saved as png files. In
> some of them the Y axis autoscales in a different way and a new origin of
> the Y axis appears in the top left corner of the frame (2.163e2 in the
> image
> attached)
>
> I don't know how I can have a reference to this number to change the
> fontsize and even their position.
> <
> http://matplotlib.1069221.n5.nabble.com/file/n47684/040_Sierra_Espu%C3%B1a_263660009.png
> >
>
>
>
> --
> View this message in context:
> http://matplotlib.1069221.n5.nabble.com/Formating-unexpected-number-when-autoscaling-Y-axis-tp47684.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170128/4eebf456/attachment-0001.html>


More information about the Matplotlib-users mailing list