[SciPy-User] contour question

Robert Thompson rthompsonj at gmail.com
Thu Jun 16 01:09:39 EDT 2011


Hi everyone,

I have a large file that contains nothing but x & y data.  I am trying 
to plot a number density contour to this but am uncertain how.  So far I 
have:

v12,logm=genfromtxt('L250N125v12.dat',unpack=True)
X,Y=meshgrid(v12,logm)

Past that I am lost.  I tried creating a 2D array from the histogram via:

num,vel=histogram(v12,bins=len(v12))
histdata = zeros((len(num),2))
for i in range(0,len(num)):
     histdata[i,0] = num[i]
     histdata[i,1] = vel[i]

Then running 'contour(X,Y,histdata)' and it just returns: TypeError: 
Inputs x and y must be 1D or 2D.

Any help would be greatly appreciated.  Right now I am making this plot 
(http://i.imgur.com/fCA1R.jpg) in SuperMongo and I'd love to switch over 
to python.  Thank you for your time!

-Robert Thompson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20110615/e817fd71/attachment.html>


More information about the SciPy-User mailing list