{
 "cells": [
  {
   "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": [
    "`violin` plots are similar to box plots, but provide a better sense of the distribution of data. Note that `violin` plots depend on the `scipy` library."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e0f6ecc7-0f6a-4590-9c98-da10a674b9b0",
   "metadata": {},
   "outputs": [],
   "source": [
    "ds = xr.tutorial.open_dataset('air_temperature').load()\n",
    "air = ds.air\n",
    "air"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2a137994-0a9d-4a75-8192-1e4bb4ead6c5",
   "metadata": {},
   "outputs": [],
   "source": [
    "air.hvplot.violin(y='air', by='lat', color='lat', cmap='Category20', title=\"Air Temperature vs. latitude\")"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
