Scientific notation digits at left-bottom corner of figure

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Scientific notation digits at left-bottom corner of figure

Ardeal LIANG

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

 



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.

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Eric Firing
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
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Ardeal LIANG

Hi Eric,

 

I added your code to my code:

 

 

from matplotlib.ticker import ScalarFormatter

fmt_no_sci = ScalarFormatter(
useOffset=False)
fmt_no_sci.set_scientific(
False)

# ax.fmt_xaxis = fmt_no_sci

prow = 4
pcol = 1
pidx = 0
fig = plt.figure()
pidx +=
1
axx = fig.add_subplot(prow, pcol, pidx, ylabel='rawdata')
axx.plot(np.abs(testdata))

axx.fmt_xaxis = fmt_no_sci

 

 

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

 

 

 

Best Regards,

Ardeal Liang

 

-----Original Message-----
From: Matplotlib-users [mailto:matplotlib-users-bounces+ardeal.liang=[hidden email]] On Behalf Of Eric Firing
Sent: 20171027 16:00
To: [hidden email]
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

[hidden email]

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.

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Ardeal LIANG
In reply to this post by Eric Firing

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.

 

 

 

Best Regards,

Ardeal Liang

 

-----Original Message-----
From: Matplotlib-users [mailto:matplotlib-users-bounces+ardeal.liang=[hidden email]] On Behalf Of Eric Firing
Sent: 20171027 16:00
To: [hidden email]
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

[hidden email]

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.

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Eric Firing
In reply to this post by Ardeal LIANG
I'm getting a different result, but on the basic point we now agree:
the ScalarFormatter is not the right tool for this.  What you need is a
function that takes a number and returns the kind of string you want.

Examples:

def format_as_int(num):
     return str(int(num))

def format_float_no_sci(num):
     return "%f" % num

Eric

On 2017/10/26 10:07 PM, Ardeal LIANG wrote:

> Hi Eric,
>
> I added your code to my code:
>
> *from *matplotlib.ticker *import *ScalarFormatter
>
> fmt_no_sci = ScalarFormatter(useOffset=False)
> fmt_no_sci.set_scientific(False)
>
> /# ax.fmt_xaxis = fmt_no_sci
>
> /prow = 4
> pcol = 1
> pidx = 0
> fig = plt.figure()
> pidx += 1
> axx = fig.add_subplot(prow, pcol, pidx, ylabel=*'rawdata'*)
> axx.plot(np.abs(testdata))
>
> axx.fmt_xaxis = fmt_no_sci
>
> The *x axis value displayed at the left-bottom corner of the figure*is
> still scientific notation, but not decimal notation.
>
> Best Regards,
>
> Ardeal Liang
>
> -----Original Message-----
> From: Matplotlib-users
> [mailto:matplotlib-users-bounces+ardeal.liang=[hidden email]] On
> Behalf Of Eric Firing
> Sent: 2017年10月27日 16:00
> To: [hidden email]
> 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
>
> [hidden email] <mailto:[hidden email]>
>
> 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.

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Ardeal LIANG
HI Eric,

Did you review the picture attached in my former email?
I suspect you go to the wrong direction about what I want to ask.

Best Regards,
Ardeal Liang

-----Original Message-----
From: Eric Firing [mailto:[hidden email]]
Sent: 2017年10月28日 1:23
To: Ardeal LIANG <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

I'm getting a different result, but on the basic point we now agree:
the ScalarFormatter is not the right tool for this.  What you need is a function that takes a number and returns the kind of string you want.

Examples:

def format_as_int(num):
     return str(int(num))

def format_float_no_sci(num):
     return "%f" % num

Eric

On 2017/10/26 10:07 PM, Ardeal LIANG wrote:

> Hi Eric,
>
> I added your code to my code:
>
> *from *matplotlib.ticker *import *ScalarFormatter
>
> fmt_no_sci = ScalarFormatter(useOffset=False)
> fmt_no_sci.set_scientific(False)
>
> /# ax.fmt_xaxis = fmt_no_sci
>
> /prow = 4
> pcol = 1
> pidx = 0
> fig = plt.figure()
> pidx += 1
> axx = fig.add_subplot(prow, pcol, pidx, ylabel=*'rawdata'*)
> axx.plot(np.abs(testdata))
>
> axx.fmt_xaxis = fmt_no_sci
>
> The *x axis value displayed at the left-bottom corner of the figure*is
> still scientific notation, but not decimal notation.
>
> Best Regards,
>
> Ardeal Liang
>
> -----Original Message-----
> From: Matplotlib-users
> [mailto:matplotlib-users-bounces+ardeal.liang=[hidden email]]
> On Behalf Of Eric Firing
> Sent: 2017年10月27日 16:00
> To: [hidden email]
> 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
>
> [hidden email] <mailto:[hidden email]>
>
> 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.


________________________________
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.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Jody Klymak


On Oct 29, 2017, at  17:46 PM, Ardeal LIANG <[hidden email]> wrote:

HI Eric,

Did you review the picture attached in my former email?
I suspect you go to the wrong direction about what I want to ask.

Best Regards,
Ardeal Liang

Hi Ardeal,

Its not clear to me what you want.  Do you want 3.2 x 10^3 instead of 0.0032?  The former is scientific and the latter decimal.

Thanks,  Jody




-----Original Message-----
From: Eric Firing [[hidden email]]
Sent: 2017年10月28日 1:23
To: Ardeal LIANG <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

I'm getting a different result, but on the basic point we now agree:
the ScalarFormatter is not the right tool for this.  What you need is a function that takes a number and returns the kind of string you want.

Examples:

def format_as_int(num):
    return str(int(num))

def format_float_no_sci(num):
    return "%f" % num

Eric

On 2017/10/26 10:07 PM, Ardeal LIANG wrote:
Hi Eric,

I added your code to my code:

*from *matplotlib.ticker *import *ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(False)

/# ax.fmt_xaxis = fmt_no_sci

/prow = 4
pcol = 1
pidx = 0
fig = plt.figure()
pidx += 1
axx = fig.add_subplot(prow, pcol, pidx, ylabel=*'rawdata'*)
axx.plot(np.abs(testdata))

axx.fmt_xaxis = fmt_no_sci

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

Best Regards,

Ardeal Liang

-----Original Message-----
From: Matplotlib-users
[[hidden email]]
On Behalf Of Eric Firing
Sent: 2017年10月27日 16:00
To: [hidden email]
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

[hidden email] <[hidden email]>

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.


________________________________
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.
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Ardeal LIANG

Hi Jody,

 

Please check the red ellipse in the picture.

 

I want the value 1.85092e+06 to be 1850922 in the red ellipse in the following picture.

 

 

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.

 

 

 

 

Best Regards,

Ardeal Liang

 

From: Jody Klymak [mailto:[hidden email]]
Sent: 20171030 10:24
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

 



On Oct 29, 2017, at  17:46 PM, Ardeal LIANG <[hidden email]> wrote:

 

HI Eric,

Did you review the picture attached in my former email?
I suspect you go to the wrong direction about what I want to ask.

Best Regards,
Ardeal Liang

 

Hi Ardeal,

 

Its not clear to me what you want.  Do you want 3.2 x 10^3 instead of 0.0032?  The former is scientific and the latter decimal.

 

Thanks,  Jody

 

 




-----Original Message-----
From: Eric Firing [
[hidden email]]
Sent: 2017
1028 1:23
To: Ardeal LIANG <
[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

I'm getting a different result, but on the basic point we now agree:
the ScalarFormatter is not the right tool for this.  What you need is a function that takes a number and returns the kind of string you want.

Examples:

def format_as_int(num):
    return str(int(num))

def format_float_no_sci(num):
    return "%f" % num

Eric

On 2017/10/26 10:07 PM, Ardeal LIANG wrote:

Hi Eric,

I added your code to my code:

*from *matplotlib.ticker *import *ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(False)

/# ax.fmt_xaxis = fmt_no_sci

/prow = 4
pcol = 1
pidx = 0
fig = plt.figure()
pidx += 1
axx = fig.add_subplot(prow, pcol, pidx, ylabel=*'rawdata'*)
axx.plot(np.abs(testdata))

axx.fmt_xaxis = fmt_no_sci

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

Best Regards,

Ardeal Liang

-----Original Message-----
From: Matplotlib-users
[[hidden email]]
On Behalf Of Eric Firing
Sent: 2017
1027 16:00
To: [hidden email]
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

[hidden email] <[hidden email]>

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.



________________________________
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.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
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.

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Mike Kaufman-3
In reply to this post by Jody Klymak
I believe he's talking about the coordinates label in the navigation
toolbar...

M

On 10/29/17 10:24 PM, Jody Klymak wrote:

>
>
>> On Oct 29, 2017, at  17:46 PM, Ardeal LIANG <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>> HI Eric,
>>
>> Did you review the picture attached in my former email?
>> I suspect you go to the wrong direction about what I want to ask.
>>
>> Best Regards,
>> Ardeal Liang
>
> Hi Ardeal,
>
> Its not clear to me what you want.  Do you want 3.2 x 10^3 instead of
> 0.0032?  The former is scientific and the latter decimal.
>
> Thanks,  Jody
>
>
>
>>
>> -----Original Message-----
>> From: Eric Firing [mailto:[hidden email]]
>> Sent: 2017年10月28日 1:23
>> To: Ardeal LIANG <[hidden email]
>> <mailto:[hidden email]>>; [hidden email]
>> <mailto:[hidden email]>
>> Subject: Re: [Matplotlib-users] Scientific notation digits at
>> left-bottom corner of figure
>>
>> I'm getting a different result, but on the basic point we now agree:
>> the ScalarFormatter is not the right tool for this.  What you need is
>> a function that takes a number and returns the kind of string you want.
>>
>> Examples:
>>
>> def format_as_int(num):
>>     return str(int(num))
>>
>> def format_float_no_sci(num):
>>     return "%f" % num
>>
>> Eric
>>
>> On 2017/10/26 10:07 PM, Ardeal LIANG wrote:
>>> Hi Eric,
>>>
>>> I added your code to my code:
>>>
>>> *from *matplotlib.ticker *import *ScalarFormatter
>>>
>>> fmt_no_sci = ScalarFormatter(useOffset=False)
>>> fmt_no_sci.set_scientific(False)
>>>
>>> /# ax.fmt_xaxis = fmt_no_sci
>>>
>>> /prow = 4
>>> pcol = 1
>>> pidx = 0
>>> fig = plt.figure()
>>> pidx += 1
>>> axx = fig.add_subplot(prow, pcol, pidx, ylabel=*'rawdata'*)
>>> axx.plot(np.abs(testdata))
>>>
>>> axx.fmt_xaxis = fmt_no_sci
>>>
>>> The *x axis value displayed at the left-bottom corner of the figure*is
>>> still scientific notation, but not decimal notation.
>>>
>>> Best Regards,
>>>
>>> Ardeal Liang
>>>
>>> -----Original Message-----
>>> From: Matplotlib-users
>>> [mailto:matplotlib-users-bounces+ardeal.liang=[hidden email]]
>>> On Behalf Of Eric Firing
>>> Sent: 2017年10月27日 16:00
>>> To: [hidden email] <mailto:[hidden email]>
>>> 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
>>>
>>> [hidden email] <mailto:[hidden email]>
>>> <mailto:[hidden email]>
>>>
>>> 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.
>>
>>
>> ________________________________
>> 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.
>> _______________________________________________
>> Matplotlib-users mailing list
>> [hidden email] <mailto:[hidden email]>
>> https://mail.python.org/mailman/listinfo/matplotlib-users
>
>
>
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Jody Klymak
In reply to this post by Ardeal LIANG
Did you try:

from matplotlib.ticker import ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(True)  # NOTE True instead of False.

I think you just said it backwards: You want scientific ntoation, not decimal notation.

Cheers,   Jody


On Oct 29, 2017, at  19:29 PM, Ardeal LIANG <[hidden email]> wrote:

Hi Jody,
 
Please check the red ellipse in the picture.
 
I want the value 1.85092e+06 to be 1850922 in the red ellipse in the following picture.
 
 
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.
<image001.jpg>
 
 
 
 
Best Regards,
Ardeal Liang
 
From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:24
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure
 
 


On Oct 29, 2017, at  17:46 PM, Ardeal LIANG <[hidden email]> wrote:
 
HI Eric,

Did you review the picture attached in my former email?
I suspect you go to the wrong direction about what I want to ask.

Best Regards,
Ardeal Liang
 
Hi Ardeal,
 
Its not clear to me what you want.  Do you want 3.2 x 10^3 instead of 0.0032?  The former is scientific and the latter decimal.
 
Thanks,  Jody
 
 



-----Original Message-----
From: Eric Firing [
[hidden email]]
Sent: 2017
1028 1:23
To: Ardeal LIANG <
[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

I'm getting a different result, but on the basic point we now agree:
the ScalarFormatter is not the right tool for this.  What you need is a function that takes a number and returns the kind of string you want.

Examples:

def format_as_int(num):
    return str(int(num))

def format_float_no_sci(num):
    return "%f" % num

Eric

On 2017/10/26 10:07 PM, Ardeal LIANG wrote:

Hi Eric,

I added your code to my code:

*from *matplotlib.ticker *import *ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(False)

/# ax.fmt_xaxis = fmt_no_sci

/prow = 4
pcol = 1
pidx = 0
fig = plt.figure()
pidx += 1
axx = fig.add_subplot(prow, pcol, pidx, ylabel=*'rawdata'*)
axx.plot(np.abs(testdata))

axx.fmt_xaxis = fmt_no_sci

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

Best Regards,

Ardeal Liang

-----Original Message-----
From: Matplotlib-users
[[hidden email]]
On Behalf Of Eric Firing
Sent: 2017
1027 16:00
To: [hidden email]
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

[hidden email] <[hidden email]>

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.


________________________________
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.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
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.


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Ardeal LIANG

Hi Jody,

 

I apologize if I said it backwards!

I think you now get what I want.

 

I tried your code. It didn’t work still.

 

Best Regards,

Ardeal Liang

 

From: Jody Klymak [mailto:[hidden email]]
Sent: 20171030 10:34
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

Did you try:

from matplotlib.ticker import ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(True)  # NOTE True instead of False.

I think you just said it backwards: You want scientific ntoation, not decimal notation.

Cheers,   Jody

 



On Oct 29, 2017, at  19:29 PM, Ardeal LIANG <[hidden email]> wrote:

 

Hi Jody,

 

Please check the red ellipse in the picture.

 

I want the value 1.85092e+06 to be 1850922 in the red ellipse in the following picture.

 

 

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.

<image001.jpg>

 

 

 

 

Best Regards,

Ardeal Liang

 

From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:24
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

 




On Oct 29, 2017, at  17:46 PM, Ardeal LIANG <[hidden email]> wrote:

 

HI Eric,

Did you review the picture attached in my former email?
I suspect you go to the wrong direction about what I want to ask.

Best Regards,
Ardeal Liang

 

Hi Ardeal,

 

Its not clear to me what you want.  Do you want 3.2 x 10^3 instead of 0.0032?  The former is scientific and the latter decimal.

 

Thanks,  Jody

 

 





-----Original Message-----
From: Eric Firing [
[hidden email]]
Sent: 2017
1028 1:23
To: Ardeal LIANG <
[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

I'm getting a different result, but on the basic point we now agree:
the ScalarFormatter is not the right tool for this.  What you need is a function that takes a number and returns the kind of string you want.

Examples:

def format_as_int(num):
    return str(int(num))

def format_float_no_sci(num):
    return "%f" % num

Eric

On 2017/10/26 10:07 PM, Ardeal LIANG wrote:


Hi Eric,

I added your code to my code:

*from *matplotlib.ticker *import *ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(False)

/# ax.fmt_xaxis = fmt_no_sci

/prow = 4
pcol = 1
pidx = 0
fig = plt.figure()
pidx += 1
axx = fig.add_subplot(prow, pcol, pidx, ylabel=*'rawdata'*)
axx.plot(np.abs(testdata))

axx.fmt_xaxis = fmt_no_sci

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

Best Regards,

Ardeal Liang

-----Original Message-----
From: Matplotlib-users
[[hidden email]]
On Behalf Of Eric Firing
Sent: 2017
1027 16:00
To: [hidden email]
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

[hidden email] <[hidden email]>

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.



________________________________
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.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
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.

 



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.

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Ardeal LIANG

Hi All,

 

You can try to run the following code.

If I put the mouse on the figure, the digit of x axis displayed on the left-bottom corner is scientific notation which is not what I want. I want it to be decimal notation.

 

 

testdata = np.arange(0, 10000000, 1)

# fmt_no_sci = ScalarFormatter(useOffset=False)
# fmt_no_sci.set_scientific(False)
# ax.fmt_xaxis = fmt_no_sci


from matplotlib.ticker import ScalarFormatter

fmt_no_sci = ScalarFormatter(
useOffset=False)
fmt_no_sci.set_scientific(
True# NOTE True instead of False.



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

 

 

 

Best Regards,

Ardeal Liang

 

From: Ardeal LIANG [mailto:[hidden email]]
Sent: 20171030 10:37
To: Jody Klymak <[hidden email]>; Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: RE: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

Hi Jody,

 

I apologize if I said it backwards!

I think you now get what I want.

 

I tried your code. It didn’t work still.

 

Best Regards,

Ardeal Liang

 

From: Jody Klymak [[hidden email]]
Sent: 20171030 10:34
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

Did you try:

from matplotlib.ticker import ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(True)  # NOTE True instead of False.

I think you just said it backwards: You want scientific ntoation, not decimal notation.

Cheers,   Jody

 

 

On Oct 29, 2017, at  19:29 PM, Ardeal LIANG <[hidden email]> wrote:

 

Hi Jody,

 

Please check the red ellipse in the picture.

 

I want the value 1.85092e+06 to be 1850922 in the red ellipse in the following picture.

 

 

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.

<image001.jpg>

 

 

 

 

Best Regards,

Ardeal Liang

 

From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:24
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

 



On Oct 29, 2017, at  17:46 PM, Ardeal LIANG <[hidden email]> wrote:

 

HI Eric,

Did you review the picture attached in my former email?
I suspect you go to the wrong direction about what I want to ask.

Best Regards,
Ardeal Liang

 

Hi Ardeal,

 

Its not clear to me what you want.  Do you want 3.2 x 10^3 instead of 0.0032?  The former is scientific and the latter decimal.

 

Thanks,  Jody

 

 




-----Original Message-----
From: Eric Firing [
[hidden email]]
Sent: 2017
1028 1:23
To: Ardeal LIANG <
[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

I'm getting a different result, but on the basic point we now agree:
the ScalarFormatter is not the right tool for this.  What you need is a function that takes a number and returns the kind of string you want.

Examples:

def format_as_int(num):
    return str(int(num))

def format_float_no_sci(num):
    return "%f" % num

Eric

On 2017/10/26 10:07 PM, Ardeal LIANG wrote:

Hi Eric,

I added your code to my code:

*from *matplotlib.ticker *import *ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(False)

/# ax.fmt_xaxis = fmt_no_sci

/prow = 4
pcol = 1
pidx = 0
fig = plt.figure()
pidx += 1
axx = fig.add_subplot(prow, pcol, pidx, ylabel=*'rawdata'*)
axx.plot(np.abs(testdata))

axx.fmt_xaxis = fmt_no_sci

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

Best Regards,

Ardeal Liang

-----Original Message-----
From: Matplotlib-users
[[hidden email]]
On Behalf Of Eric Firing
Sent: 2017
1027 16:00
To: [hidden email]
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

[hidden email] <[hidden email]>

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.



________________________________
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.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
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.

 

 


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.



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.

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Jody Klymak
In reply to this post by Ardeal LIANG
Maybe?


def format_coord(x, y):
    return 'x=%4.4e, y=%4.4e’%(x, y))  # or whatever formatting you want

ax.format_coord = format_coord


Cheers,   Jody



On Oct 29, 2017, at  19:36 PM, Ardeal LIANG <[hidden email]> wrote:

Hi Jody,
 
I apologize if I said it backwards!
I think you now get what I want.
 
I tried your code. It didn’t work still.
 
Best Regards,
Ardeal Liang
 
From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:34
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure
 
Did you try:

from matplotlib.ticker import ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(True)  # NOTE True instead of False.

I think you just said it backwards: You want scientific ntoation, not decimal notation.

Cheers,   Jody
 


On Oct 29, 2017, at  19:29 PM, Ardeal LIANG <[hidden email]> wrote:
 
Hi Jody,
 
Please check the red ellipse in the picture.
 
I want the value 1.85092e+06 to be 1850922 in the red ellipse in the following picture.
 
 
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.
<image001.jpg>
 
 
 
 
Best Regards,
Ardeal Liang
 
From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:24
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure
 
 



On Oct 29, 2017, at  17:46 PM, Ardeal LIANG <[hidden email]> wrote:
 
HI Eric,

Did you review the picture attached in my former email?
I suspect you go to the wrong direction about what I want to ask.

Best Regards,
Ardeal Liang
 
Hi Ardeal,
 
Its not clear to me what you want.  Do you want 3.2 x 10^3 instead of 0.0032?  The former is scientific and the latter decimal.
 
Thanks,  Jody
 
 




-----Original Message-----
From: Eric Firing [
[hidden email]]
Sent: 2017
1028 1:23
To: Ardeal LIANG <
[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

I'm getting a different result, but on the basic point we now agree:
the ScalarFormatter is not the right tool for this.  What you need is a function that takes a number and returns the kind of string you want.

Examples:

def format_as_int(num):
    return str(int(num))

def format_float_no_sci(num):
    return "%f" % num

Eric

On 2017/10/26 10:07 PM, Ardeal LIANG wrote:


Hi Eric,

I added your code to my code:

*from *matplotlib.ticker *import *ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(False)

/# ax.fmt_xaxis = fmt_no_sci

/prow = 4
pcol = 1
pidx = 0
fig = plt.figure()
pidx += 1
axx = fig.add_subplot(prow, pcol, pidx, ylabel=*'rawdata'*)
axx.plot(np.abs(testdata))

axx.fmt_xaxis = fmt_no_sci

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

Best Regards,

Ardeal Liang

-----Original Message-----
From: Matplotlib-users
[[hidden email]]
On Behalf Of Eric Firing
Sent: 2017
1027 16:00
To: [hidden email]
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

[hidden email] <[hidden email]>

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.


________________________________
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.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
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.
 


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.


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Ardeal LIANG

Hi Jody,

 

Did you check the picture I attached? You are still in the wrong direction about what I want……………..

Please check the digit in the red ellipse in my picture!!!!!!!!!!!!!!

 

Best Regards,

Ardeal Liang

 

From: Jody Klymak [mailto:[hidden email]]
Sent: 20171030 10:44
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

Maybe?

 

 

def format_coord(x, y):

    return 'x=%4.4e, y=%4.4e’%(x, y))  # or whatever formatting you want

 

ax.format_coord = format_coord

 

 

Cheers,   Jody

 

 



On Oct 29, 2017, at  19:36 PM, Ardeal LIANG <[hidden email]> wrote:

 

Hi Jody,

 

I apologize if I said it backwards!

I think you now get what I want.

 

I tried your code. It didn’t work still.

 

Best Regards,

Ardeal Liang

 

From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:34
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

Did you try:

from matplotlib.ticker import ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(True)  # NOTE True instead of False.

I think you just said it backwards: You want scientific ntoation, not decimal notation.

Cheers,   Jody

 




On Oct 29, 2017, at  19:29 PM, Ardeal LIANG <[hidden email]> wrote:

 

Hi Jody,

 

Please check the red ellipse in the picture.

 

I want the value 1.85092e+06 to be 1850922 in the red ellipse in the following picture.

 

 

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.

<image001.jpg>

 

 

 

 

Best Regards,

Ardeal Liang

 

From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:24
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

 





On Oct 29, 2017, at  17:46 PM, Ardeal LIANG <[hidden email]> wrote:

 

HI Eric,

Did you review the picture attached in my former email?
I suspect you go to the wrong direction about what I want to ask.

Best Regards,
Ardeal Liang

 

Hi Ardeal,

 

Its not clear to me what you want.  Do you want 3.2 x 10^3 instead of 0.0032?  The former is scientific and the latter decimal.

 

Thanks,  Jody

 

 






-----Original Message-----
From: Eric Firing [
[hidden email]]
Sent: 2017
1028 1:23
To: Ardeal LIANG <
[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

I'm getting a different result, but on the basic point we now agree:
the ScalarFormatter is not the right tool for this.  What you need is a function that takes a number and returns the kind of string you want.

Examples:

def format_as_int(num):
    return str(int(num))

def format_float_no_sci(num):
    return "%f" % num

Eric

On 2017/10/26 10:07 PM, Ardeal LIANG wrote:



Hi Eric,

I added your code to my code:

*from *matplotlib.ticker *import *ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(False)

/# ax.fmt_xaxis = fmt_no_sci

/prow = 4
pcol = 1
pidx = 0
fig = plt.figure()
pidx += 1
axx = fig.add_subplot(prow, pcol, pidx, ylabel=*'rawdata'*)
axx.plot(np.abs(testdata))

axx.fmt_xaxis = fmt_no_sci

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

Best Regards,

Ardeal Liang

-----Original Message-----
From: Matplotlib-users
[[hidden email]]
On Behalf Of Eric Firing
Sent: 2017
1027 16:00
To: [hidden email]
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

[hidden email] <[hidden email]>

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.



________________________________
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.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
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.

 

 


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.

 



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.

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Jody Klymak
ax.format_coord is the function that formats the numbers shown in the red ellipse of your picture.  Given that knowledge you can put anything in that red ellipse you want.

Cheers,   Jody

On Oct 29, 2017, at  19:46 PM, Ardeal LIANG <[hidden email]> wrote:

Hi Jody,
 
Did you check the picture I attached? You are still in the wrong direction about what I want……………..
Please check the digit in the red ellipse in my picture!!!!!!!!!!!!!!
 
Best Regards,
Ardeal Liang
 
From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:44
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure
 
Maybe?
 
 
def format_coord(x, y):
    return 'x=%4.4e, y=%4.4e’%(x, y))  # or whatever formatting you want
 
ax.format_coord = format_coord
 
 
Cheers,   Jody
 
 


On Oct 29, 2017, at  19:36 PM, Ardeal LIANG <[hidden email]> wrote:
 
Hi Jody,
 
I apologize if I said it backwards!
I think you now get what I want.
 
I tried your code. It didn’t work still.
 
Best Regards,
Ardeal Liang
 
From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:34
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure
 
Did you try:

from matplotlib.ticker import ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(True)  # NOTE True instead of False.

I think you just said it backwards: You want scientific ntoation, not decimal notation.

Cheers,   Jody
 



On Oct 29, 2017, at  19:29 PM, Ardeal LIANG <[hidden email]> wrote:
 
Hi Jody,
 
Please check the red ellipse in the picture.
 
I want the value 1.85092e+06 to be 1850922 in the red ellipse in the following picture.
 
 
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.
<image001.jpg>
 
 
 
 
Best Regards,
Ardeal Liang
 
From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:24
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure
 
 




On Oct 29, 2017, at  17:46 PM, Ardeal LIANG <[hidden email]> wrote:
 
HI Eric,

Did you review the picture attached in my former email?
I suspect you go to the wrong direction about what I want to ask.

Best Regards,
Ardeal Liang
 
Hi Ardeal,
 
Its not clear to me what you want.  Do you want 3.2 x 10^3 instead of 0.0032?  The former is scientific and the latter decimal.
 
Thanks,  Jody
 
 





-----Original Message-----
From: Eric Firing [
[hidden email]]
Sent: 2017
1028 1:23
To: Ardeal LIANG <
[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

I'm getting a different result, but on the basic point we now agree:
the ScalarFormatter is not the right tool for this.  What you need is a function that takes a number and returns the kind of string you want.

Examples:

def format_as_int(num):
    return str(int(num))

def format_float_no_sci(num):
    return "%f" % num

Eric

On 2017/10/26 10:07 PM, Ardeal LIANG wrote:



Hi Eric,

I added your code to my code:

*from *matplotlib.ticker *import *ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(False)

/# ax.fmt_xaxis = fmt_no_sci

/prow = 4
pcol = 1
pidx = 0
fig = plt.figure()
pidx += 1
axx = fig.add_subplot(prow, pcol, pidx, ylabel=*'rawdata'*)
axx.plot(np.abs(testdata))

axx.fmt_xaxis = fmt_no_sci

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

Best Regards,

Ardeal Liang

-----Original Message-----
From: Matplotlib-users
[[hidden email]]
On Behalf Of Eric Firing
Sent: 2017
1027 16:00
To: [hidden email]
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

[hidden email] <[hidden email]>

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.


________________________________
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.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
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.
 
 

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.
 


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.


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Scientific notation digits at left-bottom corner of figure

Ardeal LIANG

This is the error message if I add your code to my test code:

Traceback (most recent call last):

  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.1.5\helpers\pydev\pydevd.py", line 1591, in <module>

    globals = debugger.run(setup['file'], None, None, is_module)

  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.1.5\helpers\pydev\pydevd.py", line 1018, in run

    pydev_imports.execfile(file, globals, locals)  # execute the script

  File "C:/work/code_python/mwsignal/misc_experiment.py", line 49

SyntaxError: Non-ASCII character '\xe2' in file C:/work/code_python/mwsignal/misc_experiment.py on line 49, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

 

 

 

Best Regards,

Ardeal Liang

 

From: Jody Klymak [mailto:[hidden email]]
Sent: 20171030 10:53
To: Ardeal LIANG <[hidden email]>
Cc: [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

ax.format_coord is the function that formats the numbers shown in the red ellipse of your picture.  Given that knowledge you can put anything in that red ellipse you want.

 

Cheers,   Jody



On Oct 29, 2017, at  19:46 PM, Ardeal LIANG <[hidden email]> wrote:

 

Hi Jody,

 

Did you check the picture I attached? You are still in the wrong direction about what I want……………..

Please check the digit in the red ellipse in my picture!!!!!!!!!!!!!!

 

Best Regards,

Ardeal Liang

 

From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:44
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

Maybe?

 

 

def format_coord(x, y):

    return 'x=%4.4e, y=%4.4e’%(x, y))  # or whatever formatting you want

 

ax.format_coord = format_coord

 

 

Cheers,   Jody

 

 




On Oct 29, 2017, at  19:36 PM, Ardeal LIANG <[hidden email]> wrote:

 

Hi Jody,

 

I apologize if I said it backwards!

I think you now get what I want.

 

I tried your code. It didn’t work still.

 

Best Regards,

Ardeal Liang

 

From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:34
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

Did you try:

from matplotlib.ticker import ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(True)  # NOTE True instead of False.

I think you just said it backwards: You want scientific ntoation, not decimal notation.

Cheers,   Jody

 





On Oct 29, 2017, at  19:29 PM, Ardeal LIANG <[hidden email]> wrote:

 

Hi Jody,

 

Please check the red ellipse in the picture.

 

I want the value 1.85092e+06 to be 1850922 in the red ellipse in the following picture.

 

 

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.

<image001.jpg>

 

 

 

 

Best Regards,

Ardeal Liang

 

From: Jody Klymak [[hidden email]] 
Sent: 20171030 10:24
To: Ardeal LIANG <[hidden email]>
Cc: Firing Eric <[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

 

 






On Oct 29, 2017, at  17:46 PM, Ardeal LIANG <[hidden email]> wrote:

 

HI Eric,

Did you review the picture attached in my former email?
I suspect you go to the wrong direction about what I want to ask.

Best Regards,
Ardeal Liang

 

Hi Ardeal,

 

Its not clear to me what you want.  Do you want 3.2 x 10^3 instead of 0.0032?  The former is scientific and the latter decimal.

 

Thanks,  Jody

 

 







-----Original Message-----
From: Eric Firing [
[hidden email]]
Sent: 2017
1028 1:23
To: Ardeal LIANG <
[hidden email]>; [hidden email]
Subject: Re: [Matplotlib-users] Scientific notation digits at left-bottom corner of figure

I'm getting a different result, but on the basic point we now agree:
the ScalarFormatter is not the right tool for this.  What you need is a function that takes a number and returns the kind of string you want.

Examples:

def format_as_int(num):
    return str(int(num))

def format_float_no_sci(num):
    return "%f" % num

Eric

On 2017/10/26 10:07 PM, Ardeal LIANG wrote:




Hi Eric,

I added your code to my code:

*from *matplotlib.ticker *import *ScalarFormatter

fmt_no_sci = ScalarFormatter(useOffset=False)
fmt_no_sci.set_scientific(False)

/# ax.fmt_xaxis = fmt_no_sci

/prow = 4
pcol = 1
pidx = 0
fig = plt.figure()
pidx += 1
axx = fig.add_subplot(prow, pcol, pidx, ylabel=*'rawdata'*)
axx.plot(np.abs(testdata))

axx.fmt_xaxis = fmt_no_sci

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

Best Regards,

Ardeal Liang

-----Original Message-----
From: Matplotlib-users
[[hidden email]]
On Behalf Of Eric Firing
Sent: 2017
1027 16:00
To: [hidden email]
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

[hidden email] <[hidden email]>

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.



________________________________
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.
_______________________________________________
Matplotlib-users mailing list
[hidden email]
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.

 

 


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.

 

 


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.

 



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.

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