From: Charlie M. <cw...@gm...> - 2006-01-31 14:55:44
|
On 1/31/06, Strauss JM <jst...@su...> <jst...@su...> wrote: > Here is what I did: > > I firstly downloaded the example "quadmesh_demo.py". > > Then I reinstalled the latest mpl (0.86.2). When I tried to run the > example I got the following error message: > > Traceback (most recent call last): > File "C:\My > Leerkabinet\Installs\Python\Sandbox\Matplotlib\matplotlib\examples\quadm > esh_demo.py", line 3, in ? > from pylab import figure,show > File "C:\Program Files\Python24\Lib\site-packages\pylab.py", line 1, > in ? > from matplotlib.pylab import * > File "C:\Program > Files\Python24\Lib\site-packages\matplotlib\pylab.py", line 217, in ? > new_figure_manager, draw_if_interactive, show =3D pylab_setup() > File "C:\Program > Files\Python24\Lib\site-packages\matplotlib\backends\__init__.py", line > 24, in pylab_setup > globals(),locals(),[backend_name]) > File "C:\Program > Files\Python24\Lib\site-packages\matplotlib\backends\backend_gtkagg.py", > line 10, in ? > from backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\ > File "C:\Program > Files\Python24\Lib\site-packages\matplotlib\backends\backend_gtk.py", > line 6, in ? > import gobject > ImportError: No module named gobject > > I then went on and changed the backend in matplotlibrc from GTKAgg to > WXAgg. Running the example resulted in the following error message: > > Traceback (most recent call last): > File "C:\My > Leerkabinet\Installs\Python\Sandbox\Matplotlib\matplotlib\examples\quadm > esh_demo.py", line 15, in ? > ax =3D fig.add_subplot(111) > File "C:\Program > Files\Python24\Lib\site-packages\matplotlib\figure.py", line 465, in > add_subplot > a =3D Subplot(self, *args, **kwargs) > File "C:\Program Files\Python24\Lib\site-packages\matplotlib\axes.py", > line 3974, in __init__ > Axes.__init__(self, fig, [self.figLeft, self.figBottom, > File "C:\Program Files\Python24\Lib\site-packages\matplotlib\axes.py", > line 331, in __init__ > self._init_axis() > File "C:\Program Files\Python24\Lib\site-packages\matplotlib\axes.py", > line 360, in _init_axis > self.xaxis =3D XAxis(self) > File "C:\Program Files\Python24\Lib\site-packages\matplotlib\axis.py", > line 501, in __init__ > self.cla() > File "C:\Program Files\Python24\Lib\site-packages\matplotlib\axis.py", > line 524, in cla > self.majorTicks.extend([self._get_tick(major=3DTrue) for i in > range(1)]) > File "C:\Program Files\Python24\Lib\site-packages\matplotlib\axis.py", > line 834, in _get_tick > return XTick(self.axes, 0, '', major=3Dmajor) > File "C:\Program Files\Python24\Lib\site-packages\matplotlib\axis.py", > line 100, in __init__ > self.tick1line =3D self._get_tick1line(loc) > File "C:\Program Files\Python24\Lib\site-packages\matplotlib\axis.py", > line 276, in _get_tick1line > markersize=3Dself._size, > File "C:\Program > Files\Python24\Lib\site-packages\matplotlib\lines.py", line 211, in > __init__ > self.set_data(xdata, ydata) > File "C:\Program > Files\Python24\Lib\site-packages\matplotlib\lines.py", line 282, in > set_data > self._segments =3D unmasked_index_ranges(mask) > File "C:\Program > Files\Python24\Lib\site-packages\matplotlib\lines.py", line 69, in > unmasked_index_ranges > m =3D concatenate(((1,), mask, (1,))) > ValueError: arrays must have same number of dimensions > > This problem I have encountered this morning. Through a quick search I > came upon advice by Travis Oliphant to obtain mpl out of CVS. I only > substituted my installed lines.py with the lines.py obtained from CVS > and here is the results after running the example again: > > Traceback (most recent call last): > File "C:\My > Leerkabinet\Installs\Python\Sandbox\Matplotlib\matplotlib\examples\quadm > esh_demo.py", line 16, in ? > ax.pcolormesh(Qx,Qz,Z) > AttributeError: Subplot instance has no attribute 'pcolormesh' > > It seems that we got passed ax =3D fig.add_subplot(111) in the example, > but I am not sure whether the problem is solved. I can't reproduce unfortunately. This is an attribute for subplot with my version. Try print matplotlib.__version__ to ensure you are not picking up on older files somehow. Or try printing matplotlib.axes.__file__ as well. |