Eric,
Its Still not working, still getting white/empty areas where Z=0.0
Here's my ipython output:
[6] ga-> Znp=np.array(Z.filled())
[7] ga-> Znp
Out[7]:
array([[ 0. , 0. , 0. , ..., 0. ,
0. , 0. ],
[ 0. , 0. , 0. , ..., 0. ,
0. , 0. ],
[ 0. , 0. , 0. , ..., 0. ,
0. , 0. ],
...,
[ 1.023 , 1.551 , 2.5079999 , ..., 0.72600001,
0.85799998, 1.023 ],
[ 1.58399999, 1.74899995, 1.9799999 , ..., 0.92400002,
1.41899991, 1.58399999],
[ 0. , 0. , 0. , ..., 0. ,
0. , 0. ]])
[8] ga-> Lv=(0,1,3,5,6,7,8,9,10,12,14,16,18,20,25,30,35,40,50,75)
[9] ga-> norm = mpl.colors.BoundaryNorm(Lv,256)
[10] plt.contourf(Znp, Lv, norm=norm)
Out[10]:
[11] Znp[0,0]
Out[11]: 0.0
[12] Znp[-1,0]
Out[12]: 0.0
[13] Znp[1,0]
Out[13]: 0.0
[14] Znp[0,1]
Out[14]: 0.0
[15] Znp[0,-1]
Out[15]: 0.0
This is very frustrating. :(
Is there anything else Im missing here?
anything else I can try?
Im beginning to think that negative/"less than zero" values are actually being
plotted in those land areas, even though my array is only showing zeros, '0.0'.
Is there any way I can plot the output in a grid format?
i.e. print the text value of each point in the array at each point on the plot?
This way, I can see if a '0.0' value is really being plotted in those
white/blank areas.
Or, is there another/better way to keep diagnosing the problem?
P.Romero
----------------------------------------
> Date: Sun, 15 Mar 2009 19:38:36 -1000
> From: [email protected]
> Subject: Re: [Matplotlib-users] FW: basemap.contourf, colormap,
> extend='none', & levels array question
> To: [email protected]
> CC: [email protected]
>
> Pablo Romero wrote:
>> Eric,
>>
>> the GrADS interface is called 'pygrads'.
>> it was developed by arlindo da silva of the 'opengrads' project; a project
>> aimed at extending & enhancing the capabilities of grads by adding
>> 'extensions' to the core grads engine.
>>
>> Many users are switching to plotting with pygrads due to the fact that
>> matplotlib is a much richer, more powerful, more mature/extensive plotting
>> environment.
>>
>> So, GrADS users can manipulate gridded data in grads, export through
>> pygrads, and create nicer/more elaborate plots using matplotlib ;)
>>
>> http://opengrads.org/wiki/index.php?title=Python_Interface_to_GrADS
>>
>>
>>
>> as for the solution you offered, I tried doing the following:
>>
>> cs = m.contourf(X,Y,Z.filled(),Lv,norm=norm,cmap=plt.cm.jet)
>>
>> but I still got a plot with the '0.0' (land) areas plotted as
>> 'white'/missing?.
>>
>> Does it matter that the output I provided from the "Z.mask" command showed
>> all 'false' for the mask array?
>
> All this is strange again. I did not expect Z.mask to be all False.
>
> Try
>
> import numpy as np
> Znp = np.array(Z.filled(0.0))
>
> and then contour that instead of Z. If that doesn't work, then check
> the corner values of Znp:
>
> Znp[0,0], Znp[-1,0] etc.
>
> Eric
_________________________________________________________________
Windows Live⢠Contacts: Organize your contact list.
http://windowslive.com/connect/post/marcusatmicrosoft.spaces.live.com-Blog-cns!503D1D86EBB2B53C!2285.entry?ocid=TXT_TAGLM_WL_UGC_Contacts_032009
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users