Hi Jeff,
Here is an example which results in af plot with some of the longitudes
wrongly marked W on my computer:
#!/usr/bin/env /usr/bin/python
import pylab
import matplotlib.toolkits.basemap as basemap
def plot_test(filename):
pylab.clf()
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[0],lat[0],lon[-1],lat[-1],resolution='l')
# Compute native map projection coordinates for lat/lon grid.
xlon, ylat = m(*pylab.meshgrid(lon,lat))
m.contourf(xlon,ylat,data)
m.drawcoastlines()
m.drawparallels(lat,labels=[1,0,0,0])
m.drawmeridians(lon,labels=[0,0,0,1])
pylab.savefig(filename)
if __name__ == '__main__':
plot_test('1.png') # The longitude annotations for 40E and 100E are wrong
Kind regards,
Jesper
···
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?
>
>Kind regards,
>Jesper
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.
-Jeff