{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Most examples work across multiple plotting backends, this example is also available for:\n", "\n", "* [Matplotlib - autompg_histogram](../matplotlib/autompg_histogram.ipynb)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import holoviews as hv\n", "from holoviews import opts\n", "hv.extension('bokeh')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Declaring data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from bokeh.sampledata.autompg import autompg\n", "\n", "autompg_ds = hv.Dataset(autompg)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "hist = autompg_ds.hist(dimension='mpg', groupby='cyl', bin_range=(9, 46), num_bins=40, adjoin=False)\n", "\n", "hist.opts(opts.Histogram(alpha=0.9, width=600))" ] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 2 }