I am having problems plotting data in Basemap. I have tried some of the
different projections such as Robinson and Equidistant Cylindrical, however
kept running into the error
WARNING: x coordinate not monotonically increasing - contour plot
may not be what you expect. If it looks odd, your can either
adjust the map projection region to be consistent with your data, or
(if your data is on a global lat/lon grid) use the shiftgrid
function to adjust the data to be consistent with the map projection
region (see examples/contour_demo.py).
Having read some other forums, I see that it is due to the fact that the
longitude is based on 0-360 rather that -180 to 180. I have been trying to
rectify this with shiftgrid.
I have used shiftgrid and have moved my longitudes to -180 to 180 however I
keep running up with the error:
ValueError: lon0 outside of range of lonsin
I also manage to get one plot out, which has the right projection I want (I
am looking over the Atlantic) however the data isnt shifting in line with
the longitudes. Would anyone know why this is the case?
I have am using shiftgrid as below and the Basemap projection of Equidistant
cylindrical (I have also tried Robinson however end up with similar result
of data not moving in line with the longitude)
MSLP = aso_mslp.data
MSLP_background = np.mean(MSLP, axis = 0)
# shifting grid to run from -180 to 180 rather than 0-360
MSLP_background,lon = shiftgrid(180., MSLP_background, lon, start=False)
#setting the map in order to plot the data
map = Basemap(projection ='cyl', llcrnrlat=-90, urcrnrlat=90,
llcrnrlon=-180, urcrnrlon=180, resolution='c')
View this message in context: http://matplotlib.1069221.n5.nabble.com/Basemap-shiftgrid-tp43851.html
Sent from the matplotlib - users mailing list archive at Nabble.com.