On Wednesday, February 29, 2012, questions anon wrote:
> I have had some progress reading in the data but am unsure how to create
> lats and lons from the info I have (see above).
> the error I am receiving is:
>
> Traceback (most recent call last):
> File "d:\plotrainfall.py", line 40, in <module>
> CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet)
> File "C:\Python27\lib\site-packages\mpl_toolkits\basemap\__init__.py",
> line 3072, in contourf
> np.logical_or(outsidemask,np.logical_or(ma.getmaskarray(data),xymask))
> AttributeError: logical_or
>
>
> from the below code:
>
>
> onefile=r"E:/test_in/r19000117.txt"
>
> f=N.genfromtxt(onefile, skip_header=6, dtype=float, names=True)
> print f
>
>
> map = Basemap(projection='merc',llcrnrlat=-45,urcrnrlat=-9,
> llcrnrlon=111.975,urcrnrlon=156.525,lat_ts=0,resolution='i')
> map.drawcoastlines()
> map.drawstates()
> xi=N.linspace(111.975, 156.275, 886)
> yi=N.linspace(-44.525, -9.975, 691)
> x,y=map(*N.meshgrid(xi,yi))
> plt.title('rainfall')
> CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet)
> l,b,w,h =0.1,0.1,0.8,0.8
> cax = plt.axes([l+w+0.025, b, 0.025, h])
> plt.colorbar(CS,cax=cax, drawedges=True)
> plt.savefig((os.path.join(OutputFolder, 'rainfall.png')))
> plt.show()
> plt.close()
>
>
>
How did you install numpy? Which version are you using? What are your
imports at the top of this script?
Ben Root
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users