Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

[Matplotlib-users] question about axis scale multiplier

 [Matplotlib-users] question about axis scale multiplier From: Margherita Vittone wiersma - 2010-04-30 20:58:32 Attachments: Message as HTML     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 ```

 [Matplotlib-users] question about axis scale multiplier From: Margherita Vittone wiersma - 2010-04-30 20:58:32 Attachments: Message as HTML     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 ```
 Re: [Matplotlib-users] question about axis scale multiplier From: Eric Firing - 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 > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ```
 Re: [Matplotlib-users] question about axis scale multiplier From: Margherita Vittone wiersma - 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 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 > > Matplotlib-users@... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > ```