{
 "metadata": {
  "name": "",
  "signature": "sha256:ce270ef02cbd3d99759bebe9953554f1b0c382f30d27a0e920361bba975d2bee"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import bokeh\n",
      "bokeh.load_notebook()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from collections import OrderedDict\n",
      "\n",
      "import numpy as np\n",
      "from bokeh.charts import Histogram\n",
      "\n",
      "mu, sigma = 0, 0.5\n",
      "normal = np.random.normal(mu, sigma, 1000)\n",
      "lognormal = np.random.lognormal(mu, sigma, 1000)\n",
      "\n",
      "distributions = OrderedDict(normal=normal, lognormal=lognormal)\n",
      "normal_dist = OrderedDict(normal=normal)\n",
      "\n",
      "hist = Histogram(normal_dist, bins=50, mu=mu, sigma=sigma,\n",
      "                 title=\"kwargs, dict_input\", ylabel=\"frequency\", legend=\"top_left\",\n",
      "                 width=400, height=350, notebook=True)\n",
      "hist.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import pandas as pd\n",
      "\n",
      "df = pd.DataFrame(normal_dist)\n",
      "hist = Histogram(df, bins=50, mu=mu, sigma=sigma,\n",
      "                 title=\"no_tools, df_input\", ylabel=\"frequency\", legend=\"top_left\",\n",
      "                 tools=True, width=400, height=350, notebook=True)\n",
      "hist.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Testing with 1D array of scalars\n",
      "hist = Histogram(normal, bins=50, mu=mu, sigma=sigma,\n",
      "                 title=\"kwargs, dict_input\", ylabel=\"frequency\", legend=\"top_left\",\n",
      "                 width=500, height=350, notebook=True)\n",
      "hist.show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "distributions = OrderedDict(normal=normal, lognormal=lognormal)\n",
      "\n",
      "hist = Histogram(distributions, bins=50, notebook=True)\n",
      "hist.title(\"chained_methods, dict_input\").ylabel(\"frequency\").legend(True).width(400).height(350).show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Test case of 2D numpy array\n",
      "hist2 = Histogram(distributions, bins=50, notebook=True, facet=True)\n",
      "hist2.title(\"chained_methods, dict_input\").ylabel(\"frequency\").legend(True).width(400).height(350).show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "df = pd.DataFrame(distributions)\n",
      "\n",
      "hist = Histogram(df, bins=50, mu=mu, sigma=sigma, notebook=True)\n",
      "hist.title(\"chained_methods, df_input\").ylabel(\"frequency\").width(600).height(400).show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}