[Matplotlib-users] Scientific notation digits at left-bottom corner of figure

Ardeal LIANG ardeal.liang at philips.com
Fri Oct 27 04:45:31 EDT 2017


Hi Eric,



I add you code to my code:
fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(False)
# ax.fmt_xaxis = fmt_no_sci

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(testdata)
ax.fmt_xaxis = fmt_no_sci
plt.show(0)



The x axis value displayed at the left-bottom corner of the figure is still scientific notation, but not decimal notation.

Please check the x axis value displayed at the left-bottom corner of the figure in the red circle.

[cid:image001.jpg at 01D34F42.FD042720]







Best Regards,

Ardeal Liang



-----Original Message-----
From: Matplotlib-users [mailto:matplotlib-users-bounces+ardeal.liang=philips.com at python.org] On Behalf Of Eric Firing
Sent: 2017年10月27日 16:00
To: matplotlib-users at python.org
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure



On 2017/10/26 9:50 PM, Ardeal LIANG wrote:

> Hi,

>

> If I put the mouse on the figure, x and y axis are displayed on the

> left-bottom corner of the figure.

> but the x axis is displayed as scientific notation, I want it to be

> displayed as decimal notation.

>

> how to make x axis or y axis values displayed as decimal notation on

> the left-bottom corner?

>

> *Best Regards,*

>

> *Ardeal Liang*



Something like this, assuming your Axes is ax:



from matplotlib.ticker import ScalarFormatter



fmt_no_sci = ScalarFormatter(useOffset=False)

fmt_no_sci.set_scientific(False)



ax.fmt_xaxis = fmt_no_sci







Eric

_______________________________________________

Matplotlib-users mailing list

Matplotlib-users at python.org<mailto:Matplotlib-users at python.org>

https://mail.python.org/mailman/listinfo/matplotlib-users

________________________________
The information contained in this email may be confidential and/or legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this email is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20171027/067136b9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 137486 bytes
Desc: image001.jpg
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20171027/067136b9/attachment-0001.jpg>


More information about the Matplotlib-users mailing list