The suggestion to install matplotlib.basemap seems to be the right direction to go. However, I have been unsuccessful in importing the file by this method. This is what I have been trying.
from mpl_toolkits.basemap import Basemap import numpy as np import matplotlib.pyplot as plt import matplotlib.mlab as mlab mpl_toolkits.basemap.NetCDFFile(output.nc, mode='r', maskandscale=True, cache=None, mmap=True, username=None, password=None, verbose=False) I am getting the following error as a result. Traceback (most recent call last): File "/Users/interpott/Documents/trial.py", line 6, in <module> mpl_toolkits.basemap.NetCDFFile(output.nc, mode='r', maskandscale=True, cache=None, mmap=True, username=None, password=None, verbose=False) NameError: name 'mpl_toolkits' is not defined How do I force the location of the Netcdf file? and Why am I getting that mpl_toolkits are not defined? Thanks for the help, Jon Jeff Whitaker wrote: > > Eric Firing wrote: >> Gökhan SEVER wrote: >> >>> On Thu, Jun 11, 2009 at 1:09 PM, JPKay <kay1...@vandals.uidaho.edu >>> <mailto:kay1...@vandals.uidaho.edu>> wrote: >>> >>> >>> Hello, >>> I am trying to use matplotlib to create a quiver plot of a NetCDF >>> file with >>> the extension .nc. The Netcdf file is a series of arrays that >>> contain >>> information about the stress tensors on a globe. >>> >>> I am struggling to import the file into python and having the quiver >>> data >>> show up. >>> To import the file I have been using: >>> “ncdump file.nc <http://file.nc>” >>> >>> >>> Any thoughts would be appreciated. >>> Thanks, >>> Jon >>> -- >>> View this message in context: >>> >>> http://www.nabble.com/Quiver-plot-of-a-netcdf-file-tp23986313p23986313.html >>> Sent from the matplotlib - users mailing list archive at Nabble.com. >>> >>> >>> I recommend you to check netcdf4-python >>> (http://code.google.com/p/netcdf4-python/) >>> You can load both netcdf3 and 4 files. Additionally, there are date >>> conversion utilities which help to do transforms between numbers and >>> dates and vice versa. >>> >> >> Caution: it's great, and I use it, but it is not trivial to build and >> install. I think the OP would do best to start with pupynere. The web >> site for download looks like it is working: >> http://pypi.python.org/pypi/pupynere/ >> >> Eric >> >> >> > Note that if the OP is using basemap, an interface to pupynere is > already included (see > http://matplotlib.sourceforge.net/basemap/doc/html/api/basemap_api.html#mpl_toolkits.basemap.NetCDFFile). > > -Jeff > > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/Quiver-plot-of-a-netcdf-file-tp23986313p24003499.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users