{ "cells": [ { "cell_type": "markdown", "id": "a8373dcf-f097-454d-b97a-2f4e7bf20e62", "metadata": {}, "source": [ "# Kde" ] }, { "cell_type": "code", "execution_count": null, "id": "2ccf9fd5-9d10-4522-961d-7e8d236213b2", "metadata": {}, "outputs": [], "source": [ "import hvplot.xarray # noqa\n", "import xarray as xr" ] }, { "cell_type": "markdown", "id": "f7ed6c65-2280-4741-b89b-721110628547", "metadata": {}, "source": [ "Kernel density estimate (`kde`) provides a mechanism for showing the distribution and spread of the data. In `hvplot` the method is exposed both as `kde` and `density`." ] }, { "cell_type": "code", "execution_count": null, "id": "e8680d48-02b1-4480-96e3-d0fd7807a804", "metadata": {}, "outputs": [], "source": [ "ds = xr.tutorial.open_dataset('air_temperature').load()\n", "air = ds.air\n", "air1d = air.sel(lat=[25, 50, 75])" ] }, { "cell_type": "code", "execution_count": null, "id": "f33d3355-deaa-4bdf-befa-af20d2e46d7a", "metadata": {}, "outputs": [], "source": [ "air1d.hvplot.kde('air', by='lat', alpha=0.5)" ] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 5 }