Here is an example which results in af plot with some of the longitudes
wrongly marked W on my computer:
import matplotlib.toolkits.basemap as basemap
lat = pylab.arange(-90.,91.,30.)
lon = pylab.arange(100.,461.,60.)
data = pylab.zeros((len(lat),len(lon)))
# Create map with SW corner at 100E,90S and NW corner at 100E,90N
m = basemap.Basemap(lon,lat,lon[-1],lat[-1],resolution='l')
# Compute native map projection coordinates for lat/lon grid.
xlon, ylat = m(*pylab.meshgrid(lon,lat))
if __name__ == '__main__':
plot_test('1.png') # The longitude annotations for 40E and 100E are wrong
On Friday 24 June 2005 19:13, you wrote:
Jesper Larsen wrote:
>Hi matplotlib users,
>I'm trying to make some global plots with the basemap toolkit (version
> 0.4.2). I would like the maps to be centered at arbitrary longitudes. For
> this I use the shiftgrid method. When I make the plot and put on
> meridians some of them have wrong W/E indicators. I was wondering whether
> that was due to a wrong longitude array.
>Let's say I want to make a map with the left and right margin at 150W with
> a resolution of 60 degrees. How should the longitude array then look
> like? Is it [-150, -90, -30, 30, 90, 150, -150], [210, 270, 330, 30, 90,
> 150, 210], [210, 270, 330, 390, 450, 510, 570], or something else?
Jesper: I think the correct answer would be "any of the above" -
assuming your data array actually is ordered the same way as your
longitude array. It would help if you could post a small example.