Hist#

Download this notebook from GitHub (right-click to download).


import hvplot.xarray  # noqa
import xarray as xr

hist is often a good way to start looking at data to get a sense of the distribution. Similar methods include kde (also available as density).

ds = xr.tutorial.open_dataset('air_temperature').load()
air = ds.air
air1d = air.sel(lon=285.,lat=40.)
air1d
<xarray.DataArray 'air' (time: 2920)>
array([276.  , 276.79, 276.  , ..., 271.09, 270.29, 270.49], dtype=float32)
Coordinates:
    lat      float32 40.0
    lon      float32 285.0
  * time     (time) datetime64[ns] 2013-01-01 ... 2014-12-31T18:00:00
Attributes:
    long_name:     4xDaily Air temperature at sigma level 995
    units:         degK
    precision:     2
    GRIB_id:       11
    GRIB_name:     TMP
    var_desc:      Air temperature
    dataset:       NMC Reanalysis
    level_desc:    Surface
    statistic:     Individual Obs
    parent_stat:   Other
    actual_range:  [185.16 322.1 ]
air1d.hvplot.hist()

Customize the plot by changing the title and bar color.

air1d.hvplot.hist(title="Air Temperature over time at lat=40,lon285", color='gray')
This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.

Download this notebook from GitHub (right-click to download).