{ "metadata": { "name": "", "signature": "sha256:29083276d344959e19f5ed9609017753148fe3e68386a816fe5494e67dd4c15a" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "import bokeh.plotting as bp\n", "import datetime" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": {}, "source": [ "We're in a notebook!" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#bp.output_file(\"categorical.html\", title=\"categorical.py example\")\n", "bp.output_notebook()" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ " \n", " \n", " \n", "\n", "
\n", " \n", " \"Bokeh\n", " \n", " BokehJS successfully loaded.\n", "
" ], "metadata": {}, "output_type": "display_data" } ], "prompt_number": 2 }, { "cell_type": "markdown", "metadata": {}, "source": [ "The `figure` call is passed *before* any renderer call to glyphs that will appear on it." ] }, { "cell_type": "code", "collapsed": false, "input": [ "bp.figure()" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 3 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Aforementioned renderer." ] }, { "cell_type": "code", "collapsed": false, "input": [ "bp.segment([datetime.date(2014,1,1)], [3], [datetime.date(2014,1,7)], [3], \n", " line_width=20, line_color=\"green\", title=\"Dot Plot\", x_axis_type=\"datetime\")\n" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 4, "text": [ "" ] } ], "prompt_number": 4 }, { "cell_type": "markdown", "metadata": {}, "source": [ "This, then, works!" ] }, { "cell_type": "code", "collapsed": false, "input": [ "bp.show()" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "\n", "
\n", "\n" ], "metadata": {}, "output_type": "display_data" } ], "prompt_number": 5 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Although I did take note that due to the JSON serialization implementation, these dates are apparently assumed to start at time a certain time offset for some reason. We should take a look into that. You're welcome to open an issue over at [our GitHub](github.com/ContinuumIO/bokeh)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Karan" ] } ], "metadata": {} } ] }