|
From: ChaoYue <cha...@gm...> - 2014-08-27 09:41:43
|
Hi Michelle, I might not fully understand your problem, could you have a look at this thread and see if it helps? http://matplotlib.1069221.n5.nabble.com/Fwd-Strange-behaviour-on-plotting-data-on-Ronbinson-projection-using-Basemap-td43222.html#a43233 Cheers, Chao On Wed, Aug 27, 2014 at 9:58 AM, mmc [via matplotlib] < ml-...@n5...> wrote: > Hi All, > > 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') > > Thanks > Michelle > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://matplotlib.1069221.n5.nabble.com/Basemap-shiftgrid-tp43851.html > To start a new topic under matplotlib - users, email > ml-...@n5... > To unsubscribe from matplotlib, click here > <http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx> > . > NAML > <http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- please visit: http://www.globalcarbonatlas.org/ *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************ -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Basemap-shiftgrid-tp43851p43853.html Sent from the matplotlib - users mailing list archive at Nabble.com. |