On Tue, Oct 20, 2009 at 3:43 PM, Thomas Robitaille
<thomas.robitai...@gmail.com> wrote:
> Hi,
>
> I'm not sure what I'm doing wrong here:
>
> import matplotlib.pyplot as mpl
> from matplotlib.ticker import NullFormatter
>
> fig = mpl.figure()
> ax = fig.add_subplot(111)
> ax.xaxis.set_major_formatter(NullFormatter)
>
> This returns the error:
>
> Traceback (most recent call last):
>   File "test.py", line 6, in <module>
>     ax.xaxis.set_major_formatter(NullFormatter)
>   File "/Users/tom/Library/Python/2.6/site-packages/matplotlib/
> axis.py", line 1091, in set_major_formatter
>     formatter.set_axis(self)
> TypeError: unbound method set_axis() must be called with NullFormatter
> instance as first argument (got XAxis instance instead)
>
> Am I using set_major_formatter wrongly?

You need to use an *instance* of NullFormatter, which is the name of a
class. Try:

ax.xaxis.set_major_formatter(NullFormatter())

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to