Hi there,
I think I made a mistake with putting in a tuple in my first email, but here
is the error output from the contourf that I call within a script. I use
this script before with a square grid and there is no problem. Anyway, after
your email, I played with the script again and I think I have a problem with
reshaping the 'z' data. For some reason, the 'z' data is not shaped the same
as the meshgrid. I will try and sort it out..
Many thanks for all your help!
Shrividya
TypeError Traceback (most recent call last)
/media/ANAMIKA/crashing out Raman/script_7-03-10_co1_G-mode_spatial_map.py
in <module>()
31
32 ## This part plots the contour plot and configures all the visual
aspects.
---> 33 pylab.contourf(map_XX, map_YY, d)
34 pylab.colorbar()
35 pylab.xlim(min(map_x), max(map_x))
/usr/lib/pymodules/python2.6/matplotlib/pyplot.pyc in contourf(*args,
**kwargs)
1874 ax.hold(hold)
1875 try:
-> 1876 ret = ax.contourf(*args, **kwargs)
1877 draw_if_interactive()
1878 finally:
/usr/lib/pymodules/python2.6/matplotlib/axes.pyc in contourf(self, *args,
**kwargs)
6816 if not self._hold: self.cla()
6817 kwargs['filled'] = True
-> 6818 return mcontour.ContourSet(self, *args, **kwargs)
6819 contourf.__doc__ = mcontour.ContourSet.contour_doc
6820
/usr/lib/pymodules/python2.6/matplotlib/contour.pyc in __init__(self, ax,
*args, **kwargs)
572 raise ValueError('Either colors or cmap must be None')
573 if self.origin == 'image': self.origin =
mpl.rcParams['image.origin']
--> 574 x, y, z = self._contour_args(*args) # also sets
self.levels,
575 # self.layers
576 if self.colors is not None:
/usr/lib/pymodules/python2.6/matplotlib/contour.pyc in _contour_args(self,
*args)
761 x, y = self._initialize_x_y(z)
762 elif Nargs <=4:
--> 763 x,y,z = self._check_xyz(args[:3])
764 else:
765 raise TypeError("Too many arguments to %s; see help(%s)"
% (fn,fn))
/usr/lib/pymodules/python2.6/matplotlib/contour.pyc in _check_xyz(self,
args)
742 return x,y,z
743 if x.ndim != 1 or y.ndim != 1:
--> 744 raise TypeError("Inputs x and y must be 1D or 2D.")
745 nx, = x.shape
746 ny, = y.shape
TypeError: Inputs x and y must be 1D or 2D.
WARNING: Failure executing file: <script_7-03-10_co1_G-mode_spatial_map.py>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users