{
 "metadata": {
  "name": "",
  "signature": "sha256:d693e49e6f5e0df0c6a258a06f041a326c0b2c52fd2db89f868327403159d2ea"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "raw",
     "metadata": {},
     "source": [
      "This IPython Notebook contains simple examples of many of the basic vectorizable glyph functions that Bokeh provides. \n",
      "\n",
      "To clear all previously rendered cell outputs, select from the menu:\n",
      "\n",
      "    Cell -> All Output -> Clear"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import numpy as np\n",
      "from bokeh.plotting import *"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "N = 9"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "x = np.linspace(-2, 2, N)\n",
      "y = x**2\n",
      "sizes = np.linspace(10, 20, N)\n",
      "xpts = np.array([-.09, -.12, .0, .12, .09])\n",
      "ypts = np.array([-.1, .02, .1, .02, -.1])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "output_notebook()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "annular_wedge(x, y, 10, 20, 0.6, 4.1,\n",
      "              inner_radius_units=\"screen\", outer_radius_units = \"screen\",\n",
      "              color=\"#8888ee\", tools=\"\", title=\"annular_wedge\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "annulus(x, y, 10, 20, inner_radius_units=\"screen\", outer_radius_units = \"screen\",\n",
      "        color=\"#7FC97F\", tools=\"\", title=\"annulus\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "arc(x, y, 20, 0.6, 4.1, radius_units=\"screen\", color=\"#BEAED4\", tools=\"\", title=\"arc\", line_width=3)\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "bezier(x, y, x+0.2, y, x+0.1, y+0.1, x-0.1, y-0.1,color=\"#D95F02\", tools=\"\", title=\"bezier\", line_width=2)\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "circle(x, y, radius=0.1, radius_units=\"data\", color=\"#3288BD\", tools=\"\", title=\"circle\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "line(x, y, color=\"#F46D43\", tools=\"\", title=\"line\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "multi_line([xpts+xx for xx in x], [ypts+yy for yy in y], \n",
      "           color=\"#8073AC\", tools=\"\", title=\"multi_line\", line_width=2)\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "oval(x, y, 15, 25, angle=-0.7, \n",
      "     width_units=\"screen\", height_units=\"screen\",\n",
      "     color=\"#1D91C0\", tools=\"\", title=\"oval\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "patch(x, y, color=\"#A6CEE3\", tools=\"\", title=\"patch\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "patches([xpts+xx for xx in x], [ypts+yy for yy in y], color=\"#FB9A99\", tools=\"\", title=\"patches\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "quad(x, x-0.1, y, y-0.1, color=\"#B3DE69\", tools=\"\", title=\"quad\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "quadratic(x, y, x+0.2, y, x+0.1, y+0.1, color=\"#4DAF4A\", tools=\"\", title=\"quadratic\", line_width=3)\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "ray(x, y, 45, -0.7, color=\"#FB8072\", tools=\"\", title=\"ray\", line_width=2)\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "rect(x, y, 10, 20, -0.7, \n",
      "     width_units=\"screen\", height_units=\"screen\",\n",
      "     color=\"#CAB2D6\", tools=\"\", title=\"rect\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "segment(x, y, x-0.1, y-0.1, color=\"#F4A582\", tools=\"\", title=\"segment\", line_width=3)\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "square(x, y, size=sizes, color=\"#74ADD1\",\n",
      "       tools=\"\", title=\"square\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "wedge(x, y, 15, 0.6, 4.1, \n",
      "      radius_units=\"screen\",\n",
      "      color=\"#B3DE69\", tools=\"\", title=\"wedge\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "scatter(x, y, marker=\"circle_x\", size=sizes, color=\"#DD1C77\", fill_color=None,\n",
      "       tools=\"\", title=\"circle_x\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "scatter(x, y, marker=\"triangle\", size=sizes, color=\"#99D594\",\n",
      "       line_width=2, tools=\"\", title=\"triangle\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "scatter(x, y, marker=\"o\", size=sizes, color=\"#80B1D3\",\n",
      "       line_width=3, tools=\"\", title=\"circle\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "scatter(x, y, marker=\"cross\", size=sizes, color=\"#E6550D\", fill_color=None,\n",
      "       line_width=2, tools=\"\", title=\"cross\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "scatter(x, y, marker=\"diamond\", size=sizes, color=\"#1C9099\",\n",
      "       line_width=2, tools=\"\", title=\"diamond\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "scatter(x, y, marker=\"inverted_triangle\", size=sizes, color=\"#DE2D26\",\n",
      "       line_width=2, tools=\"\", title=\"invtriangle\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "scatter(x, y, marker=\"square_x\", size=sizes, color=\"#FDAE6B\", fill_color=None,\n",
      "       line_width=2, tools=\"\", title=\"square_x\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "scatter(x, y, marker=\"asterisk\", size=sizes, color=\"#F0027F\", fill_color=None,\n",
      "       line_width=2, tools=\"\", title=\"asterisk\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "scatter(x, y, marker=\"square_cross\", size=sizes, color=\"#7FC97F\", fill_color=None,\n",
      "       line_width=2, tools=\"\", title=\"square_cross\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "scatter(x, y, marker=\"diamond_cross\", size=sizes, color=\"#386CB0\", fill_color=None,\n",
      "       line_width=2, tools=\"\", title=\"diamond_cross\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "scatter(x, y, marker=\"circle_cross\", size=sizes, color=\"#FB8072\", fill_color=None,\n",
      "       line_width=2, tools=\"\", title=\"circle_cross\")\n",
      "show()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}