[Matplotlib-users] plotting netcdf data on a map in matplotlib
jklymak at uvic.ca
Thu Mar 30 16:38:19 EDT 2017
I’m not an expert on cartopy.
1) can you plot this data w/o using basemap?
2) why do you have the “squeeze” command in there?
3) I’m not clear what the problem is with your image from the snippet you sent. Is it just an issue with the longitude wrapping? Some projections demand longitude must be between -180 and 180. i.e. lon[lon>=180]=lon[lon>=180]-360. You may also need to re-order your longitude and data so that longitude is monotonically increasing.
4) I recommend xarray when dealing w/ netcdf files, though maybe that is overkill for your problem.
A minimal working example with a link to the bad data always helps.
I’m sure with a bit of experimentation and use of google you can get this working.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Matplotlib-users