Formating unexpected number when autoscaling Y axis

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Formating unexpected number when autoscaling Y axis

solisgbmpl
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.
example plot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Formating unexpected number when autoscaling Y axis

tcaswell
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 <[hidden email]> 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
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Loading...