subplot does not work in svn

I have just updated to a matplotlib build from SVN, and now all my subplots generate errors:

(Pdb) rows

Out[3]: 2

(Pdb) columns

Out[3]: 2

(Pdb) num

Out[3]: 1

(Pdb) subplot(rows, columns, num)

*** KeyError: ‘axes.formatter.limits’

I really dont know why this is happening, so I would appreciate any assistance.

Thanks,

Chris

···


Chris Fonnesbeck + Atlanta, GA + http://trichech.us

Chris,

I suspect it is a problem with your matplotlibrc file; you could try stripping it down to bare minimum, as in the svn root directory. Another possibility is that your update is somehow incomplete or scrambled with an earlier installation.

If that doesn't work, try making a minimal script that illustrates the problem.

examples/newscalarformatter_demo.py works fine, so I don't think the basic subplot mechanism is broken.

Chris Fonnesbeck wrote:

I have just updated to a matplotlib build from SVN, and now all my subplots generate errors:

(Pdb) rows
Out[3]: 2
(Pdb) columns
Out[3]: 2
(Pdb) num
Out[3]: 1
(Pdb) subplot(rows, columns, num)
*** KeyError: 'axes.formatter.limits'

I think this is a valid key in rcParams.

Doesn't the error trigger a full traceback that shows where it is coming from?

Eric

···

I really dont know why this is happening, so I would appreciate any assistance.

Thanks,
Chris

--
Chris Fonnesbeck + Atlanta, GA + http://trichech.us

I am still getting this problem. Here is an ipython traceback of a very simple plot:

In [1]: from pylab import *

In [2]: plot([3,45,6],[7,9,2])

···

On 1/6/07, Eric Firing <efiring@…202…> wrote:

Chris,

I suspect it is a problem with your matplotlibrc file; you could try
stripping it down to bare minimum, as in the svn root directory.
Another possibility is that your update is somehow incomplete or

scrambled with an earlier installation.

If that doesn’t work, try making a minimal script that illustrates the
problem.

examples/newscalarformatter_demo.py works fine, so I don’t think the
basic subplot mechanism is broken.

Chris Fonnesbeck wrote:

I have just updated to a matplotlib build from SVN, and now all my
subplots generate errors:

(Pdb) rows
Out[3]: 2
(Pdb) columns
Out[3]: 2

(Pdb) num
Out[3]: 1
(Pdb) subplot(rows, columns, num)
*** KeyError: ‘axes.formatter.limits’

I think this is a valid key in rcParams.

Doesn’t the error trigger a full traceback that shows where it is coming

from?


exceptions.KeyError Traceback (most recent call last)

/Users/chris/

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/pylab.py in plot(*args, **kwargs)

2036 def plot(*args, **kwargs):

2037 # allow callers to override the hold state by passing hold=True|False

→ 2038 b = ishold()

2039 h = popd(kwargs, ‘hold’, None)

2040 if h is not None:

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/pylab.py in ishold()

935 Return the hold status of the current axes

936 “”"

→ 937 return gca().ishold()

938

939 def isinteractive():

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/pylab.py in gca(**kwargs)

881 “”"

882

→ 883 ax = gcf().gca(**kwargs)

884 return ax

885

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/figure.py in gca(self, **kwargs)

677 ax = self._axstack()

678 if ax is not None: return ax

→ 679 return self.add_subplot(111, **kwargs)

680 gca.doc = dedent(gca.doc) % artist.kwdocd

681

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/figure.py in add_subplot(self, *args, **kwargs)

504 a = PolarSubplot(self, *args, **kwargs)

505 else:

→ 506 a = Subplot(self, *args, **kwargs)

507

508

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/axes.py in init(self, fig, *args, **kwargs)

4909 “”"

4910 SubplotBase.init(self, fig, *args)

→ 4911 Axes.init(self, fig, [self.figLeft, self.figBottom,

4912 self.figW, self.figH
], **kwargs)

4913

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/axes.py in init(self, fig, rect, axisbg, frameon, sharex, sharey, label, **kwargs)

437

438 # this call may differ for non-sep axes, eg polar

→ 439 self._init_axis()

440

441

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/axes.py in _init_axis(self)

468 def _init_axis(self):

469 “move this out of init because non-separable axes don’t use it”

→ 470 self.xaxis = XAxis(self)

471 self.yaxis = YAxis(self)

472

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/axis.py in init(self, axes)

512 self.minorTicks =

513

→ 514 self.cla()

515

516 def get_children(self):

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/axis.py in cla(self)

533 ‘clear the current axis’

534 self.set_major_locator
(AutoLocator())

→ 535 self.set_major_formatter(ScalarFormatter())

536 self.set_minor_locator(NullLocator())

537 self.set_minor_formatter(NullFormatter())

/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/ticker.py in init(self, useOffset, useMathText)

269 self.format
= ‘’

270 self._scientific = True

→ 271 self._powerlimits = rcParams[‘axes.formatter.limits’]

272

273 def call(self, x, pos=None):

KeyError: ‘axes.formatter.limits’

The thing is, I deleted my entire ~/.matplotlib directory, hoping to start clean. Where does matplotlib get its info when a .matplotlibrc is not present in my home directory?

Thanks


Chris Fonnesbeck + Atlanta, GA + http://trichech.us

Chris, try

xmode verbose

in ipython right before running your code. This will make the
traceback dump even more detail, which may help John and his evil
minions track down your little critter even faster.

Cheers,

f

···

On 1/31/07, Chris Fonnesbeck <chris@...941...> wrote:

I am still getting this problem. Here is an ipython traceback of a very
simple plot:

In [1]: from pylab import *