{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Most examples work across multiple plotting backends equivalent, this example is also available for:\n", "\n", "* [Bokeh - area_chart](../bokeh/area_chart.ipynb)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import holoviews as hv\n", "from holoviews import opts\n", "\n", "hv.extension('matplotlib')\n", "hv.output(fig='svg')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Declaring data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# create some example data\n", "python=np.array([2, 3, 7, 5, 26, 221, 44, 233, 254, 265, 266, 267, 120, 111])\n", "pypy=np.array([12, 33, 47, 15, 126, 121, 144, 233, 254, 225, 226, 267, 110, 130])\n", "jython=np.array([22, 43, 10, 25, 26, 101, 114, 203, 194, 215, 201, 227, 139, 160])\n", "\n", "dims = dict(kdims='time', vdims='memory')\n", "python = hv.Area(python, label='python', **dims)\n", "pypy = hv.Area(pypy, label='pypy', **dims)\n", "jython = hv.Area(jython, label='jython', **dims)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "overlay = (python * pypy * jython).opts(opts.Area(alpha=0.5))\n", "overlay.relabel(\"Area Chart\") + hv.Area.stack(overlay).relabel(\"Stacked Area Chart\")" ] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 2 }