{
 "metadata": {
  "name": "",
  "signature": "sha256:200f8d67a7b9b4a3dc12c022c8a003f2e74c0d8fb9e9c1e04c1e0ece446adef0"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import numpy as np"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from bokeh.plotting import *\n",
      "from bokeh.models import ColumnDataSource"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "output_notebook()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "N = 300\n",
      "x = np.linspace(0, 4*np.pi, N)\n",
      "y1 = np.sin(x)\n",
      "y2 = np.cos(x)\n",
      "y3 = np.sin(x) + np.cos(x)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "s1 = figure(plot_width=350, plot_height=350)\n",
      "s1.scatter(x, y1)\n",
      "\n",
      "# Linked panning in Bokeh is expressed by sharing ranges between\n",
      "# plots. Note below that s2 is reated with the `x_range` and `y_range` \n",
      "# keyword arguments, and supplied with the same ranges from s1. Here, \n",
      "# this links both axes together.\n",
      "s2 = figure(plot_width=350, plot_height=350, \n",
      "            x_range=s1.x_range, y_range=s1.y_range)\n",
      "s2.scatter(x, y2)\n",
      "\n",
      "# It is possible to share just one range or the other, to link plots\n",
      "# along only one dimension. For the third plot, we only link the x-axis\n",
      "s3 = figure(plot_width=350, plot_height=350, x_range=s1.x_range)\n",
      "s3.scatter(x, y3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "p = gridplot([[s1,s2, s3]])\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}
