John [H2O] wrote:
> Jeff Whitaker wrote:
>   
>> John:  I don't have time to look at your code right now, but let me just 
>> make some general comments about plotting images on maps.  If you want 
>> to use imshow, the data your are plotting must coincide exactly with 
>> your map plot area.  So, for example if you want to plot a global 
>> lat/lon grid on a north polar stereographic projection, you have to 
>> interpolate to a rectangular grid in projection coordinates that fits in 
>> the map region.  However, in practice I find it's almost never worth 
>> doing this.  You can plot the data in the native coordinates on almost 
>> any map projection region using pcolormesh or contourf,  Just calculate 
>> the x,y values of the of the data grid, and pass those values along with 
>> the data to either one of those methods.  Is there any particular reason 
>> you want to use imshow, instead of pcolormesh or contourf?
>>
>> -Jeff
>>
>>
>>     
>
> Jeff,
>
> I started using pcolormesh, but ran into the problem that I really required
> a log scale color map for the plotting. As I recall, this could only be done
> with imshow - but perhaps that has changed? 
John:

The color mapping is the same with imshow or pcolormesh.  See the recent 
thread on "logarithmic colormaps".
> Regardless, I've done some
> further testing. It seems I have the following problems with it:
>
> 1) It is much more 'coarse' in the coloring, imshow offers a finer/smoother
> looking gradient. 
>   
Only way around that with pcolormesh is to interpolate to a finer grid.  
Imshow will interpolate the colors, pcolormesh will not.
> 2) The bigger problem occurs when plotting in npstere, which I use quite
> often. Maybe I have to add a wrap around, but as it is, I get a 'seam' at
> the -180/180 meridian. 
>   
Just add a wraparound - that's easy with the addcyclic function.
> 3) At the pole, there is a empty spot, creating a hole in my plots. This I
> can't work with... :s
>   
That's because you don't have a grid point at the pole.  You could add 
one (by extrapolating the from the highest latitude).

-Jeff
> Thanks again for your input.
>
> -john 
>
>
>   


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to