Thanks for responding. It is 'sort of' good to know that it can't be
explained as I just thought it was my incompetency!
I tried the np rather than N but that made no differences.
thanks again


On Thu, Mar 15, 2012 at 7:48 AM, Benjamin Root <ben.r...@ou.edu> wrote:

>
>
> On Tue, Mar 13, 2012 at 4:23 PM, questions anon 
> <questions.a...@gmail.com>wrote:
>
>> also I have tried running it on a different computer and the same error
>> occurred
>>
>>
>> On Wed, Mar 14, 2012 at 8:22 AM, questions anon <questions.a...@gmail.com
>> > wrote:
>>
>>> thanks for looking into this Goyo.
>>> The complete code:
>>>
>>>
>>> import numpy as N
>>> import matplotlib.pyplot as plt
>>> from numpy import ma as MA
>>> from mpl_toolkits.basemap import Basemap
>>> import os
>>>
>>> shapefile="E:/GIS_layers/DSE_REGIONS"
>>> inputfile=r"d:/BoMdata/r19000117.txt"
>>> outputfolder=r"d:/BoMdata/outputfolder"
>>>
>>> f=N.genfromtxt(inputfile, skip_header=6,  dtype=float, names=True)
>>> print f[0:5]
>>>
>>>
>>> map = Basemap(projection='merc',llcrnrlat=-45,urcrnrlat=-9,
>>>
>>> llcrnrlon=111.975,urcrnrlon=156.525,lat_ts=0,resolution='i')
>>> map.drawcoastlines()
>>> map.drawstates()
>>> map.readshapefile(shapefile, 'DSE_REGIONS')
>>>
>>> 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()
>>>
>>>
>>> and the complete error:
>>>
>>>
>>> Traceback (most recent call last):
>>>   File "d:/BoMdata/plotrainfall_v2.py", line 23, 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
>>>
>>> Any feedback/ideas will be greatly appreciated.
>>>
>>>
>>>
> Your error is very strange and it just simply should not be happening.  On
> a completely wild guess, could you try replacing "import numpy as N" with
> "import numpy as np" and replace all instances of "N" with "np"?
>
> 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

Reply via email to