Skip to content

Commit

Permalink
Added examples for grouped histograms
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jul 14, 2017
1 parent 1feee48 commit fadef91
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 0 deletions.
66 changes: 66 additions & 0 deletions examples/gallery/demos/bokeh/autompg_histogram.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"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 numpy as np\n",
"import pandas as pd\n",
"import holoviews as hv\n",
"hv.extension('bokeh','matplotlib')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Declaring data"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"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": [
"%%opts Histogram (alpha=0.9) [width=600]\n",
"autompg_ds.hist(dimension='mpg', groupby='cyl', adjoin=False)"
]
}
],
"metadata": {
},
"nbformat": 4,
"nbformat_minor": 2
}
66 changes: 66 additions & 0 deletions examples/gallery/demos/matplotlib/autompg_histogram.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Most examples work across multiple plotting backends, this example is also available for:\n",
"\n",
"* [Bokeh - autompg_histogram](../bokeh/autompg_histogram.ipynb)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"import holoviews as hv\n",
"hv.extension('matplotlib')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Declaring data"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"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": [
"%%opts Histogram [fig_size=200 aspect=2]\n",
"autompg_ds.hist(dimension='mpg', groupby='cyl', adjoin=False)"
]
}
],
"metadata": {
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit fadef91

Please sign in to comment.