Installation and a quick example

Install with conda

The best way to install NCPlot is with conda — this pulls in cartopy automatically, which some plots use for coastlines and map projections.

console
conda install -c conda-forge ncplot

Install with pip

Install the stable release from PyPI:

console
pip install ncplot
Note

The PyPI package does not include the optional cartopy dependency. Some plots will look better with it installed — see the cartopy installation guide if you install via pip.

A two-minute example

Once installed, plotting a netCDF file is a single function call. This example plots sea surface temperature from NOAA's COBE2 dataset, streamed directly from a remote OPeNDAP server — no download required:

python
from ncplot import view

url = "https://psl.noaa.gov/thredds/dodsC/Datasets/COBE2/sst.mon.ltm.1981-2010.nc"

view(url, vars="sst", coast=True)

This opens an interactive plot of sea surface temperature, with coastlines drawn in. Here's the actual output — pan, zoom and hover on it below:

sst.mon.ltm.1981-2010.nc — view(vars="sst", coast=True)

Continue with the quickstart to see the xarray accessor and the command line viewer.