How do you use ticklabel_format?

Hello,

    I'm trying to make a simple plot that doesn't use scientific
notation for the x axis since the axise only goes from 1 to 1600. I
tried using ticklabel_format like this:

from pylab import *

l, cltt = loadtxt('ABF_20_20.dat',unpack=True)
semilogx(l, cltt)
xlim(1,1600)
ax = gca()
ax.ticklabel_format(style='plain',axis='x')
show()

I get this error "This method only works with the ScalarFormatter".
which seems to be the error refered to in the documentation. However,
I'm not sure how to fix the problem? Is there way to use this
ScalarFormatter some how? Did I code it wrong?

   If anyone knows how to get the xaxis to not display scientific
notation this would be helpful. Thanks.

                    Joseph Smidt

···

--
------------------------------------------------------------------------
Joseph Smidt <josephsmidt@...287...>

Physics and Astronomy
4129 Frederick Reines Hall
Irvine, CA 92697-4575
Office: 949-824-3269

Joseph Smidt wrote:

Hello,

    I'm trying to make a simple plot that doesn't use scientific
notation for the x axis ...
Is there way to use this
ScalarFormatter some how? ...

does this help?

from pylab import *
a = arange(1600)
plot(a,a)
xscale('log')
from matplotlib.ticker import ScalarFormatter
ax = gca().xaxis
ax.set_major_formatter(ScalarFormatter())

best,
sebastian.

Sebastian,

    Thanks, your hint worked.

···

On Wed, Feb 3, 2010 at 1:54 PM, Sebastian Busch <webmaster@...2599...> wrote:

Joseph Smidt wrote:

Hello,

I&#39;m trying to make a simple plot that doesn&#39;t use scientific

notation for the x axis ...
Is there way to use this
ScalarFormatter some how? ...

does this help?

from pylab import *
a = arange(1600)
plot(a,a)
xscale('log')
from matplotlib.ticker import ScalarFormatter
ax = gca().xaxis
ax.set_major_formatter(ScalarFormatter())

best,
sebastian.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

--
------------------------------------------------------------------------
Joseph Smidt <josephsmidt@...287...>

Physics and Astronomy
4129 Frederick Reines Hall
Irvine, CA 92697-4575
Office: 949-824-3269