How to use ncplot in Python

Using ncplot is very easy. It let’s you plot the contents of a NetCDF automatically. To plot a file in Python, preferably a Jupyter notebook, do the following:

[1]:
from ncplot import ncplot
ncplot("https://psl.noaa.gov/thredds/dodsC/Datasets/COBE2/sst.mon.ltm.1981-2010.nc")
/home/robert/anaconda3/envs/ncplot/lib/python3.6/site-packages/xarray/coding/times.py:427: SerializationWarning: Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range
  dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime)
/home/robert/anaconda3/envs/ncplot/lib/python3.6/site-packages/numpy/core/_asarray.py:83: SerializationWarning: Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range
  return array(a, dtype, copy=False, order=order)
[1]:

If you only want to plot a specific variable, you can do the following:

If you want to plot a list of variables, do the following:

How to use ncplot as a command line tool

ncplot operates as a command line tool, letting you view the contents of a NetCDF file on a website. This feature only works in development version right now. All you need to do is provide the file you want to look at:

$ ncplot example.nc