HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/holoviews/examples/gallery/demos/bokeh/step_chart.ipynb
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Most examples work across multiple plotting backends, this example is also available for:\n",
    "\n",
    "* [Matplotlib - step_chart example](../bokeh/step_chart_example.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": [
    "## Declare data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# build a dataset where multiple columns measure the same thing\n",
    "stamp    = [.33, .33, .34, .37, .37, .37, .37, .39, .41, .42,\n",
    "            .44, .44, .44, .45, .46, .49, .49]\n",
    "postcard = [.20, .20, .21, .23, .23, .23, .23, .24, .26, .27,\n",
    "            .28, .28, .29, .32, .33, .34, .35]\n",
    "\n",
    "group = \"U.S. Postage Rates (1999-2015)\"\n",
    "stamp    = hv.Curve(stamp, vdims='Rate per ounce', label='stamp', group=group)\n",
    "postcard = hv.Curve(postcard, vdims='Rate per ounce', label='postcard', group=group)\n",
    "postage = (stamp * postcard)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Plot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "postage.opts(\n",
    "    opts.Curve(interpolation='steps-mid', width=400, height=400,\n",
    "               line_dash=hv.Cycle(values=['dashed', 'solid'])),\n",
    "    opts.Overlay(legend_position='top_left'))"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}