{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Most examples work across multiple plotting backends, this example is also available for:\n", "\n", "* [Matplotlib - autompg_violins](../matplotlib/autompg_violins.ipynb)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import holoviews as hv\n", "from holoviews import dim\n", "\n", "from bokeh.sampledata.autompg import autompg\n", "hv.extension('bokeh')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Declaring data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "violin = hv.Violin(autompg, ('yr', 'Year'), ('mpg', 'Miles per Gallon')).redim.range(mpg=(8, 45))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "violin.opts(height=500, width=900, violin_fill_color=dim('Year').str(), cmap='Set1')" ] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 2 }