File: C:/Users/fred/anaconda3/Lib/site-packages/holoviews/examples/gallery/demos/bokeh/dot_example.ipynb
{
"cells": [
{
"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": [
"## Declare data"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"factors = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\"]\n",
"x = [50, 40, 65, 10, 25, 37, 80, 60]\n",
"scatter = hv.Scatter((factors, x))\n",
"spikes = hv.Spikes(scatter)\n",
"\n",
"x = [\"foo\", \"foo\", \"foo\", \"bar\", \"bar\", \"bar\", \"baz\", \"baz\", \"baz\"]\n",
"y = [\"foo\", \"bar\", \"baz\", \"foo\", \"bar\", \"baz\", \"foo\", \"bar\", \"baz\"]\n",
"z = [0, 1, 2, 3, 4, 5, 6, 7, 8]\n",
"heatmap = hv.HeatMap((x, y, z))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Plot"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"(heatmap + spikes * scatter).opts(\n",
" opts.Scatter(size=15, fill_color=\"orange\", line_color=\"green\"),\n",
" opts.Spikes(color='green', line_width=4, labelled=[], invert_axes=True, color_index=None),\n",
" opts.Layout(shared_axes=False))"
]
}
],
"metadata": {
"language_info": {
"name": "python",
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}