There are three equivalent ways to plot a netCDF file with NCPlot: from plain Python, through the xarray accessor, or from the command line. Pick whichever fits how you already work.
Import view and point it at a file path or URL. With no vars argument, every variable in the file is plotted:
from ncplot import view # plot everything in the file view("example.nc") # or just the variable(s) you care about view("example.nc", vars="sst") view("example.nc", vars=["sst", "sss"])
x can also be a directory of netCDF files, or a remote OPeNDAP/THREDDS URL — NCPlot reads them the same way it reads a single local file.
If you already have data open in xarray, import the accessor once to add a .ncplot namespace to every Dataset and DataArray:
import ncplot.xarray import xarray as xr ds = xr.open_dataset("example.nc") ds.ncplot.view() # works on a single DataArray too ds["sst"].ncplot.view(coast=True)
This calls the same view function underneath, so every keyword argument documented in the API reference works here too.
NCPlot also installs a command line tool. Point it at one or more files and it opens an interactive view in your browser — no Python session needed:
$ ncplot example.nc $ ncplot https://psl.noaa.gov/thredds/dodsC/Datasets/COBE2/sst.mon.ltm.1981-2010.nc
Pass more than one file (or URL) and NCPlot views them together.
view() accepts, including coast and clim, in the API reference.out="figure.html" instead of displaying it inline.