SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Margherita V. w. <vi...@fn...> - 2010年04月30日 20:58:32
Attachments: sendscat.GIF
HI,
i am making a scatter plot and i simply use defaults for tick formatting etc;
when i plot the data the plot show on the x axis a multiplier scaling with scintific notation;
i would like to get rid of it , the data looks like this:
values5 = [-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47
 -102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52
 -102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52
 ......]
values6 = [-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52,
 -98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,
 -98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55,
 -98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58,
 ....]
and when the plot is shown as in the the attachement it show the scintific notation
at the x scale.
Any input is appreciated. Thank you much
bye for now
Margherita
From: Eric F. <ef...@ha...> - 2010年04月30日 23:02:05
Margherita Vittone wiersma wrote:
> HI,
> i am making a scatter plot and i simply use defaults for tick formatting etc;
> when i plot the data the plot show on the x axis a multiplier scaling with scintific notation;
> i would like to get rid of it , the data looks like this:
> 
> values5 = [-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47
> -102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52
> -102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52
> ......]
> 
> values6 = [-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52,
> -98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,
> -98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55,
> -98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58,
> ....]
> 
> 
> and when the plot is shown as in the the attachement it show the scintific notation
> at the x scale.
If it were just a matter of scientific notation, you would be able to 
use the ticklabel_format Axes method with style='plain' to turn it off. 
 The real problem, though, is that an offset is being used. With mpl 
from svn, you can also turn that off with the ticklabel_format() 
function or method, but with released versions you need something a 
little more arcane, e.g.
import pyplot as plt
plt.scatter(values5, values6)
ax = plt.gca()
ax.xaxis.set_major_formatter(plt.ScalarFormatter(useOffset=False))
#ax.xaxis.set_major_locator(plt.MaxNLocator(nbins=6, steps=[1,2,5,10]))
plt.draw()
The commented-out line reduces the number of tick marks; you may want to 
do this because without the offset, the tick labels can get a bit long 
and crowded.
Eric
> 
> Any input is appreciated. Thank you much
> bye for now
> 
> Margherita
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> HI,
> i am making a scatter plot and i simply use defaults for tick formatting etc;
> when i plot the data the plot show on the x axis a multiplier scaling with scintific notation;
> i would like to get rid of it , the data looks like this:
> 
> values5 = [-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47
> -102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52
> -102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52
> ......]
> 
> values6 = [-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52,
> -98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,
> 	 -98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55,
> 	 -98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58,
> ....]
> 
> 
> and when the plot is shown as in the the attachement it show the scintific notation
> at the x scale.
> 
> Any input is appreciated. Thank you much
> bye for now
> 
> Margherita
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Margherita V. w. <vi...@fn...> - 2010年05月03日 16:15:26
Hello Eric,
thank you so much fo your feedback and the fix! it works as expected.
bye for now
Margherita
----- Original Message -----
From: Eric Firing <ef...@ha...>
Date: Friday, April 30, 2010 6:01 pm
Subject: Re: [Matplotlib-users] question about axis scale multiplier
> Margherita Vittone wiersma wrote:
> > HI,
> > i am making a scatter plot and i simply use defaults for tick 
> formatting etc;
> > when i plot the data the plot show on the x axis a multiplier 
> scaling with scintific notation;
> > i would like to get rid of it , the data looks like this:
> > 
> > values5 = [-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47
> > -102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52
> > -102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52
> > ......]
> > 
> > values6 = [-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52,
> > -98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,
> > -98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55,
> > -98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58,
> > ....]
> > 
> > 
> > and when the plot is shown as in the the attachement it show the 
> scintific notation
> > at the x scale.
> 
> If it were just a matter of scientific notation, you would be able to 
> 
> use the ticklabel_format Axes method with style='plain' to turn it 
> off. 
> The real problem, though, is that an offset is being used. With 
> mpl 
> from svn, you can also turn that off with the ticklabel_format() 
> function or method, but with released versions you need something a 
> little more arcane, e.g.
> 
> import pyplot as plt
> plt.scatter(values5, values6)
> ax = plt.gca()
> ax.xaxis.set_major_formatter(plt.ScalarFormatter(useOffset=False))
> #ax.xaxis.set_major_locator(plt.MaxNLocator(nbins=6, steps=[1,2,5,10]))
> plt.draw()
> 
> The commented-out line reduces the number of tick marks; you may want 
> to 
> do this because without the offset, the tick labels can get a bit 
> long 
> and crowded.
> 
> Eric
> 
> 
> > 
> > Any input is appreciated. Thank you much
> > bye for now
> > 
> > Margherita
> > 
> > 
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > HI,
> > i am making a scatter plot and i simply use defaults for tick 
> formatting etc;
> > when i plot the data the plot show on the x axis a multiplier 
> scaling with scintific notation;
> > i would like to get rid of it , the data looks like this:
> > 
> > values5 = [-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47
> > -102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52
> > -102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52
> > ......]
> > 
> > values6 = [-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52,
> > -98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,
> > -98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55,
> > -98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58,
> > ....]
> > 
> > 
> > and when the plot is shown as in the the attachement it show the 
> scintific notation
> > at the x scale.
> > 
> > Any input is appreciated. Thank you much
> > bye for now
> > 
> > Margherita
> > 
> > 
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > ------------------------------------------------------------------------------
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /