From: Viraj V. <vir...@gm...> - 2007-06-30 20:44:07
|
hello ppl, hey i hav 3 .dat files... one has 1 column of x coords, another has 1 column of the same number of y coords and the last .dat file has the same number of corresponding values of a property[temperature] at those points in 1 column.... i was wondering how i cud make a contour of this data with the last .dat file being the z-values... i hav written the following code( saf2.py)[mind u ppl am a newbie @ python+matplotlib]... from pylab import * x = load('xcord2.dat') y = load('ycord2.dat') X, Y = meshgrid(x, y) Z = load('output1im.dat') contour(X,Y,Z) show() the following errors crop up: Traceback (most recent call last): File "F:\Python25\saf2.py", line 9, in <module> contour(X,Y,Z) File "F:\Python25\Lib\site-packages\matplotlib\pylab.py", line 1776, in contour ret = gca().contour(*args, **kwargs) File "F:\Python25\Lib\site-packages\matplotlib\axes.py", line 4674, in contour return ContourSet(self, *args, **kwargs) File "F:\Python25\Lib\site-packages\matplotlib\contour.py", line 429, in __init__ x, y, z = self._contour_args(*args) # also sets self.levels, File "F:\Python25\Lib\site-packages\matplotlib\contour.py", line 601, in _contour_args x,y,z = self._check_xyz(args[:3]) File "F:\Python25\Lib\site-packages\matplotlib\contour.py", line 577, in _check_xyz raise TypeError("Input z must be a 2D array.") TypeError: Input z must be a 2D array. wat errors am i making? |