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@lists.sourceforge.net
> matplotlib-users List Signup and Options