Repository: bokeh/bokeh

Issue:
(Re)move `tests/compat`, `tests/glyphs`, `tests/notebook`
Under the top-level directory there are three directories that I think need tidying up:
- tests/compat
- tests/glyphs
- tests/notebook

As far as I can tell the files under `tests/compat` and `tests/notebook` aren't used anywhere.

The files under `tests/glyphs` are all referenced by `__example__` property in `bokeh/models/glyphs.py` e.g. https://github.com/bokeh/bokeh/blob/master/bokeh/models/glyphs.py#L27

But I can't seem them referenced elsewhere. As such, `tests` doesn't seem like the right directory for them.

Proposals:
1) Delete [`tests/compat`](https://github.com/bokeh/bokeh/tree/master/tests/compat) and [`tests/notebook`](https://github.com/bokeh/bokeh/tree/master/tests/notebook)
2a) Move [`tests/glyphs`](https://github.com/bokeh/bokeh/tree/master/tests/glyphs) to `bokeh/models/__examples__`; or
2b) Move  [`tests/glyphs`](https://github.com/bokeh/bokeh/tree/master/tests/glyphs) to `bokeh/models/tests/examples`; or
2c) Move  [`tests/glyphs`](https://github.com/bokeh/bokeh/tree/master/tests/glyphs) to `bokeh/models/<???>` <suggestions welcome> 



Discussion:
My intention was that they are simple enough to currently also be used as real image diff test sources, that is, actually **_failing**_ the test when there is an image diff. We can't reliably do this for every image diff "test" we run now, but I think we could for these. 

In any case, apart from that ide, these scripts are only needed by the docs. I would not want to move them under the `bokeh` directory and actually ship them with the library, and I think they are too simple/boring to go under `examples`

Actually maybe `examples/reference` or something would do. 

Resolving patch:
diff --git a/bokeh/models/glyphs.py b/bokeh/models/glyphs.py
--- a/bokeh/models/glyphs.py
+++ b/bokeh/models/glyphs.py
@@ -62,7 +62,7 @@ class AnnularWedge(XYGlyph):
 
     '''
 
-    __example__ = "tests/glyphs/AnnularWedge.py"
+    __example__ = "examples/reference/models/AnnularWedge.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -109,7 +109,7 @@ class Annulus(XYGlyph):
 
     '''
 
-    __example__ = "tests/glyphs/Annulus.py"
+    __example__ = "examples/reference/models/Annulus.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -144,7 +144,7 @@ class Arc(XYGlyph):
 
     '''
 
-    __example__ = "tests/glyphs/Arc.py"
+    __example__ = "examples/reference/models/Arc.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -187,7 +187,7 @@ class Bezier(Glyph):
 
     '''
 
-    __example__ = "tests/glyphs/Bezier.py"
+    __example__ = "examples/reference/models/Bezier.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -234,7 +234,7 @@ class Ellipse(XYGlyph):
 
     '''
 
-    __example__ = "tests/glyphs/Ellipse.py"
+    __example__ = "examples/reference/models/Ellipse.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -274,7 +274,7 @@ class HBar(Glyph):
 
     '''
 
-    __example__ = "tests/glyphs/HBar.py"
+    __example__ = "examples/reference/models/HBar.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -442,7 +442,7 @@ class ImageURL(XYGlyph):
 
     '''
 
-    __example__ = "tests/glyphs/ImageURL.py"
+    __example__ = "examples/reference/models/ImageURL.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -522,7 +522,7 @@ class Line(XYGlyph):
     # functions derived from this class
     _args = ('x', 'y')
 
-    __example__ = "tests/glyphs/Line.py"
+    __example__ = "examples/reference/models/Line.py"
 
     x = NumberSpec(help="""
     The x-coordinates for the points of the line.
@@ -544,7 +544,7 @@ class MultiLine(Glyph):
 
     '''
 
-    __example__ = "tests/glyphs/MultiLine.py"
+    __example__ = "examples/reference/models/MultiLine.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -571,7 +571,7 @@ class Oval(XYGlyph):
 
     '''
 
-    __example__ = "tests/glyphs/Oval.py"
+    __example__ = "examples/reference/models/Oval.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -613,7 +613,7 @@ class Patch(XYGlyph):
 
     '''
 
-    __example__ = "tests/glyphs/Patch.py"
+    __example__ = "examples/reference/models/Patch.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -653,7 +653,7 @@ class Patches(Glyph):
 
     '''
 
-    __example__ = "tests/glyphs/Patches.py"
+    __example__ = "examples/reference/models/Patches.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -690,7 +690,7 @@ class Quad(Glyph):
 
     '''
 
-    __example__ = "tests/glyphs/Quad.py"
+    __example__ = "examples/reference/models/Quad.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -725,7 +725,7 @@ class Quadratic(Glyph):
 
     '''
 
-    __example__ = "tests/glyphs/Quadratic.py"
+    __example__ = "examples/reference/models/Quadratic.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -764,7 +764,7 @@ class Ray(XYGlyph):
 
     '''
 
-    __example__ = "tests/glyphs/Ray.py"
+    __example__ = "examples/reference/models/Ray.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -796,7 +796,7 @@ class Rect(XYGlyph):
 
     '''
 
-    __example__ = "tests/glyphs/Rect.py"
+    __example__ = "examples/reference/models/Rect.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -844,7 +844,7 @@ class Segment(Glyph):
 
     '''
 
-    __example__ = "tests/glyphs/Segment.py"
+    __example__ = "examples/reference/models/Segment.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -875,7 +875,7 @@ class Text(XYGlyph):
 
     '''
 
-    __example__ = "tests/glyphs/Text.py"
+    __example__ = "examples/reference/models/Text.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -920,7 +920,7 @@ class VBar(Glyph):
 
     '''
 
-    __example__ = "tests/glyphs/VBar.py"
+    __example__ = "examples/reference/models/VBar.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -955,7 +955,7 @@ class Wedge(XYGlyph):
 
     '''
 
-    __example__ = "tests/glyphs/Wedge.py"
+    __example__ = "examples/reference/models/Wedge.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
diff --git a/bokeh/models/markers.py b/bokeh/models/markers.py
--- a/bokeh/models/markers.py
+++ b/bokeh/models/markers.py
@@ -82,13 +82,13 @@ class Marker(XYGlyph):
 class Asterisk(Marker):
     ''' Render asterisk '*' markers. '''
 
-    __example__ = "tests/glyphs/Asterisk.py"
+    __example__ = "examples/reference/models/Asterisk.py"
 
 
 class Circle(Marker):
     ''' Render circle markers. '''
 
-    __example__ = "tests/glyphs/Circle.py"
+    __example__ = "examples/reference/models/Circle.py"
 
     # a canonical order for positional args that can be used for any
     # functions derived from this class
@@ -124,55 +124,55 @@ class Circle(Marker):
 class CircleCross(Marker):
     ''' Render circle markers with a '+' cross through the center. '''
 
-    __example__ = "tests/glyphs/CircleCross.py"
+    __example__ = "examples/reference/models/CircleCross.py"
 
 class CircleX(Marker):
     ''' Render circle markers with an 'X' cross through the center. '''
 
-    __example__ = "tests/glyphs/CircleX.py"
+    __example__ = "examples/reference/models/CircleX.py"
 
 class Cross(Marker):
     ''' Render '+' cross markers. '''
 
-    __example__ = "tests/glyphs/Cross.py"
+    __example__ = "examples/reference/models/Cross.py"
 
 class Diamond(Marker):
     ''' Render diamond markers. '''
 
-    __example__ = "tests/glyphs/Diamond.py"
+    __example__ = "examples/reference/models/Diamond.py"
 
 class DiamondCross(Marker):
     ''' Render diamond markers with a '+' cross through the center. '''
 
-    __example__ = "tests/glyphs/DiamondCross.py"
+    __example__ = "examples/reference/models/DiamondCross.py"
 
 
 class InvertedTriangle(Marker):
     ''' Render upside-down triangle markers. '''
 
-    __example__ = "tests/glyphs/InvertedTriangle.py"
+    __example__ = "examples/reference/models/InvertedTriangle.py"
 
 class Square(Marker):
     ''' Render a square marker, optionally rotated. '''
 
-    __example__ = "tests/glyphs/Square.py"
+    __example__ = "examples/reference/models/Square.py"
 
 class SquareCross(Marker):
     ''' Render square markers with a '+' cross through the center. '''
 
-    __example__ = "tests/glyphs/SquareCross.py"
+    __example__ = "examples/reference/models/SquareCross.py"
 
 class SquareX(Marker):
     ''' Render square markers with an 'X' cross through the center. '''
 
-    __example__ = "tests/glyphs/SquareX.py"
+    __example__ = "examples/reference/models/SquareX.py"
 
 class Triangle(Marker):
     ''' Render triangle markers. '''
 
-    __example__ = "tests/glyphs/Triangle.py"
+    __example__ = "examples/reference/models/Triangle.py"
 
 class X(Marker):
     ''' Render a 'X' cross markers. '''
 
-    __example__ = "tests/glyphs/X.py"
+    __example__ = "examples/reference/models/X.py"


Test patch:
diff --git a/tests/glyphs/AnnularWedge.py b/examples/reference/models/AnnularWedge.py
similarity index 100%
rename from tests/glyphs/AnnularWedge.py
rename to examples/reference/models/AnnularWedge.py
diff --git a/tests/glyphs/Annulus.py b/examples/reference/models/Annulus.py
similarity index 100%
rename from tests/glyphs/Annulus.py
rename to examples/reference/models/Annulus.py
diff --git a/tests/glyphs/Arc.py b/examples/reference/models/Arc.py
similarity index 100%
rename from tests/glyphs/Arc.py
rename to examples/reference/models/Arc.py
diff --git a/tests/glyphs/Asterisk.py b/examples/reference/models/Asterisk.py
similarity index 100%
rename from tests/glyphs/Asterisk.py
rename to examples/reference/models/Asterisk.py
diff --git a/tests/glyphs/Bezier.py b/examples/reference/models/Bezier.py
similarity index 100%
rename from tests/glyphs/Bezier.py
rename to examples/reference/models/Bezier.py
diff --git a/tests/glyphs/Circle.py b/examples/reference/models/Circle.py
similarity index 100%
rename from tests/glyphs/Circle.py
rename to examples/reference/models/Circle.py
diff --git a/tests/glyphs/CircleCross.py b/examples/reference/models/CircleCross.py
similarity index 100%
rename from tests/glyphs/CircleCross.py
rename to examples/reference/models/CircleCross.py
diff --git a/tests/glyphs/CircleX.py b/examples/reference/models/CircleX.py
similarity index 100%
rename from tests/glyphs/CircleX.py
rename to examples/reference/models/CircleX.py
diff --git a/tests/glyphs/Cross.py b/examples/reference/models/Cross.py
similarity index 100%
rename from tests/glyphs/Cross.py
rename to examples/reference/models/Cross.py
diff --git a/tests/glyphs/Diamond.py b/examples/reference/models/Diamond.py
similarity index 100%
rename from tests/glyphs/Diamond.py
rename to examples/reference/models/Diamond.py
diff --git a/tests/glyphs/DiamondCross.py b/examples/reference/models/DiamondCross.py
similarity index 100%
rename from tests/glyphs/DiamondCross.py
rename to examples/reference/models/DiamondCross.py
diff --git a/tests/glyphs/Ellipse.py b/examples/reference/models/Ellipse.py
similarity index 100%
rename from tests/glyphs/Ellipse.py
rename to examples/reference/models/Ellipse.py
diff --git a/tests/glyphs/HBar.py b/examples/reference/models/HBar.py
similarity index 100%
rename from tests/glyphs/HBar.py
rename to examples/reference/models/HBar.py
diff --git a/tests/glyphs/ImageURL.py b/examples/reference/models/ImageURL.py
similarity index 100%
rename from tests/glyphs/ImageURL.py
rename to examples/reference/models/ImageURL.py
diff --git a/tests/glyphs/InvertedTriangle.py b/examples/reference/models/InvertedTriangle.py
similarity index 100%
rename from tests/glyphs/InvertedTriangle.py
rename to examples/reference/models/InvertedTriangle.py
diff --git a/tests/glyphs/Line.py b/examples/reference/models/Line.py
similarity index 100%
rename from tests/glyphs/Line.py
rename to examples/reference/models/Line.py
diff --git a/tests/glyphs/MultiLine.py b/examples/reference/models/MultiLine.py
similarity index 100%
rename from tests/glyphs/MultiLine.py
rename to examples/reference/models/MultiLine.py
diff --git a/tests/glyphs/Oval.py b/examples/reference/models/Oval.py
similarity index 100%
rename from tests/glyphs/Oval.py
rename to examples/reference/models/Oval.py
diff --git a/tests/glyphs/Patch.py b/examples/reference/models/Patch.py
similarity index 100%
rename from tests/glyphs/Patch.py
rename to examples/reference/models/Patch.py
diff --git a/tests/glyphs/Patches.py b/examples/reference/models/Patches.py
similarity index 100%
rename from tests/glyphs/Patches.py
rename to examples/reference/models/Patches.py
diff --git a/tests/glyphs/Quad.py b/examples/reference/models/Quad.py
similarity index 100%
rename from tests/glyphs/Quad.py
rename to examples/reference/models/Quad.py
diff --git a/tests/glyphs/Quadratic.py b/examples/reference/models/Quadratic.py
similarity index 100%
rename from tests/glyphs/Quadratic.py
rename to examples/reference/models/Quadratic.py
diff --git a/tests/glyphs/Ray.py b/examples/reference/models/Ray.py
similarity index 100%
rename from tests/glyphs/Ray.py
rename to examples/reference/models/Ray.py
diff --git a/tests/glyphs/Rect.py b/examples/reference/models/Rect.py
similarity index 100%
rename from tests/glyphs/Rect.py
rename to examples/reference/models/Rect.py
diff --git a/tests/glyphs/Segment.py b/examples/reference/models/Segment.py
similarity index 100%
rename from tests/glyphs/Segment.py
rename to examples/reference/models/Segment.py
diff --git a/tests/glyphs/Square.py b/examples/reference/models/Square.py
similarity index 100%
rename from tests/glyphs/Square.py
rename to examples/reference/models/Square.py
diff --git a/tests/glyphs/SquareCross.py b/examples/reference/models/SquareCross.py
similarity index 100%
rename from tests/glyphs/SquareCross.py
rename to examples/reference/models/SquareCross.py
diff --git a/tests/glyphs/SquareX.py b/examples/reference/models/SquareX.py
similarity index 100%
rename from tests/glyphs/SquareX.py
rename to examples/reference/models/SquareX.py
diff --git a/tests/glyphs/Text.py b/examples/reference/models/Text.py
similarity index 100%
rename from tests/glyphs/Text.py
rename to examples/reference/models/Text.py
diff --git a/tests/glyphs/Triangle.py b/examples/reference/models/Triangle.py
similarity index 100%
rename from tests/glyphs/Triangle.py
rename to examples/reference/models/Triangle.py
diff --git a/tests/glyphs/VBar.py b/examples/reference/models/VBar.py
similarity index 100%
rename from tests/glyphs/VBar.py
rename to examples/reference/models/VBar.py
diff --git a/tests/glyphs/Wedge.py b/examples/reference/models/Wedge.py
similarity index 100%
rename from tests/glyphs/Wedge.py
rename to examples/reference/models/Wedge.py
diff --git a/tests/glyphs/X.py b/examples/reference/models/X.py
similarity index 100%
rename from tests/glyphs/X.py
rename to examples/reference/models/X.py
diff --git a/tests/compat/lc_dashed.py b/tests/compat/lc_dashed.py
deleted file mode 100644
--- a/tests/compat/lc_dashed.py
+++ /dev/null
@@ -1,30 +0,0 @@
-from matplotlib.collections import LineCollection
-import matplotlib.pyplot as plt
-import numpy as np
-
-from bokeh import mpl
-from bokeh.plotting import output_file, show
-
-# In order to efficiently plot many lines in a single set of axes,
-# add the lines all at once. Here is a simple example showing how it is done.
-
-N = 50
-x = np.arange(N)
-
-# Here are many sets of y to plot vs x
-ys = [x + i for i in x]
-
-colors = ['#ff0000', '#008000', '#0000ff', '#00bfbf', '#bfbf00', '#bf00bf', '#000000']
-
-line_segments = LineCollection([list(zip(x, y)) for y in ys],
-                               color=colors,
-                               linewidth=(0.5, 1, 1.5, 2),
-                               linestyle='dashed')
-
-ax = plt.axes()
-ax.add_collection(line_segments)
-ax.set_title('Line Collection with dashed colors')
-
-output_file("lc_dashed.html", title="lc_dashed.py example")
-
-show(mpl.to_bokeh())
diff --git a/tests/compat/lc_offsets.py b/tests/compat/lc_offsets.py
deleted file mode 100644
--- a/tests/compat/lc_offsets.py
+++ /dev/null
@@ -1,41 +0,0 @@
-from matplotlib.collections import LineCollection
-import matplotlib.pyplot as plt
-import numpy as np
-
-from bokeh import mpl
-from bokeh.plotting import output_file, show
-
-# Simulate a series of ocean current profiles, successively
-# offset by 0.1 m/s so that they form what is sometimes called
-# a "waterfall" plot or a "stagger" plot.
-
-nverts = 60
-ncurves = 20
-offs = (0.1, 0.0)
-
-rs = np.random.RandomState([12345678])
-yy = np.linspace(0, 2 * np.pi, nverts)
-ym = np.amax(yy)
-xx = (0.2 + (ym - yy) / ym) ** 2 * np.cos(yy - 0.4) * 0.5
-segs = []
-for i in range(ncurves):
-    xxx = xx + 0.02 * rs.randn(nverts)
-    curve = list(zip(xxx, yy * 100))
-    segs.append(curve)
-
-colors = [(1.0, 0.0, 0.0, 1.0), (0.0, 0.5, 0.0, 1.0), (0.0, 0.0, 1.0, 1.0),
-          (0.0, 0.75, 0.75, 1.0), (0.75, 0.75, 0, 1.0), (0.75, 0, 0.75, 1.0),
-          (0.0, 0.0, 0.0, 1.0)]
-
-col = LineCollection(segs, linewidth=5, offsets=offs)
-
-ax = plt.axes()
-ax.add_collection(col, autolim=True)
-col.set_color(colors)
-ax.set_title('Successive data offsets')
-
-fig = plt.gcf()
-
-output_file("lc_offsets.html", title="lc_offsets.py example")
-
-show(mpl.to_bokeh())
diff --git a/tests/compat/listcollection.py b/tests/compat/listcollection.py
deleted file mode 100644
--- a/tests/compat/listcollection.py
+++ /dev/null
@@ -1,58 +0,0 @@
-from matplotlib.collections import LineCollection
-import matplotlib.pyplot as plt
-import numpy as np
-
-from bokeh import mpl
-from bokeh.plotting import output_file, show
-
-
-def make_segments(x, y):
-    '''
-    Create list of line segments from x and y coordinates.
-    '''
-
-    points = np.array([x, y]).T.reshape(-1, 1, 2)
-    segments = np.concatenate([points[:-1], points[1:]], axis=1)
-
-    return segments
-
-
-def colorline(x, y, colors=None, linewidth=3, alpha=1.0):
-    '''
-    Plot a line with segments.
-    Optionally, specify segments colors and segments widths.
-    '''
-
-    # Make a list of colors cycling through the rgbcmyk series.
-    # You have several ways to input the colors:
-    # colors = ['r','g','b','c','y','m','k']
-    # colors = ['red','green','blue','cyan','yellow','magenta','black']
-    # colors = ['#ff0000', '#008000', '#0000ff', '#00bfbf', '#bfbf00', '#bf00bf', '#000000']
-    # colors = [(1.0, 0.0, 0.0, 1.0), (0.0, 0.5, 0.0, 1.0), (0.0, 0.0, 1.0, 1.0), (0.0, 0.75, 0.75, 1.0),
-    #           (0.75, 0.75, 0, 1.0), (0.75, 0, 0.75, 1.0), (0.0, 0.0, 0.0, 1.0)]
-
-    colors = ['r', 'g', 'b', 'c', 'y', 'm', 'k']
-    widths = [5, 10, 20, 40, 20, 10, 5]
-
-    segments = make_segments(x, y)
-    lc = LineCollection(segments, colors=colors, linewidth=widths, alpha=alpha)
-
-    ax = plt.gca()
-    ax.add_collection(lc)
-
-    return lc
-
-# Colored sine wave
-
-x = np.linspace(0, 4 * np.pi, 100)
-y = np.sin(x)
-
-colorline(x, y)
-
-plt.title("MPL support for ListCollection in Bokeh")
-plt.xlim(x.min(), x.max())
-plt.ylim(-1.0, 1.0)
-
-output_file("listcollection.html", title="listcollection.py example")
-
-show(mpl.to_bokeh())
diff --git a/tests/compat/polycollection.py b/tests/compat/polycollection.py
deleted file mode 100644
--- a/tests/compat/polycollection.py
+++ /dev/null
@@ -1,40 +0,0 @@
-from matplotlib.collections import PolyCollection
-import matplotlib.pyplot as plt
-import numpy as np
-
-from bokeh import mpl
-from bokeh.plotting import output_file, show
-
-# Generate data. In this case, we'll make a bunch of center-points and generate
-# verticies by subtracting random offsets from those center-points
-numpoly, numverts = 100, 4
-centers = 100 * (np.random.random((numpoly, 2)) - 0.5)
-offsets = 10 * (np.random.random((numverts, numpoly, 2)) - 0.5)
-verts = centers + offsets
-verts = np.swapaxes(verts, 0, 1)
-
-# In your case, "verts" might be something like:
-# verts = zip(zip(lon1, lat1), zip(lon2, lat2), ...)
-# If "data" in your case is a numpy array, there are cleaner ways to reorder
-# things to suit.
-
-facecolors = ['red', 'green', 'blue', 'cyan', 'yellow', 'magenta', 'black']
-edgecolors = ['cyan', 'yellow', 'magenta', 'black', 'red', 'green', 'blue']
-widths = [5, 10, 20, 10, 5]
-
-
-# Make the collection and add it to the plot.
-col = PolyCollection(verts, facecolor=facecolors, edgecolor=edgecolors,
-                     linewidth=widths, linestyle='--', alpha=0.5)
-
-ax = plt.axes()
-ax.add_collection(col)
-
-plt.xlim([-60, 60])
-plt.ylim([-60, 60])
-
-plt.title("MPL-PolyCollection support in Bokeh")
-
-output_file("polycollection.html", title="polycollection.py example")
-
-show(mpl.to_bokeh())
diff --git a/tests/notebook/glyph.ipynb b/tests/notebook/glyph.ipynb
deleted file mode 100644
--- a/tests/notebook/glyph.ipynb
+++ /dev/null
@@ -1,206 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "from numpy import pi, arange, sin, cos, ones_like"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "from bokeh.util.notebook import load_notebook\n",
-    "from bokeh.document import Document\n",
-    "from bokeh.models.glyphs import Circle\n",
-    "from bokeh.models import (\n",
-    "    Plot, DataRange1d, LinearAxis, Grid, ColumnDataSource, PanTool, WheelZoomTool\n",
-    ")"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "load_notebook()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "x = arange(-2*pi, 2*pi, 0.1)\n",
-    "y = sin(x)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "source = ColumnDataSource(data=dict(x=x, y=y))\n",
-    "xdr = DataRange1d()\n",
-    "ydr = DataRange1d()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "plot = Plot(x_range=xdr, y_range=ydr, min_border=80)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "circle = Circle(x=\"x\", y=\"y\", fill_color=\"red\", size=5, line_color=\"black\")"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "plot.add_glyph(source, circle)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "xaxis = LinearAxis()\n",
-    "plot.add_layout(xaxis, 'below')\n",
-    "\n",
-    "yaxis = LinearAxis()\n",
-    "plot.add_layout(yaxis, 'left')"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "plot.add_layout(Grid(dimension=0, ticker=xaxis.ticker) )\n",
-    "plot.add_layout(Grid(dimension=1, ticker=yaxis.ticker))"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "plot.add_tools(PanTool(), WheelZoomTool())"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "from bokeh.util.notebook import publish_display_data\n",
-    "from bokeh.embed import notebook_div\n",
-    "data = {'text/html': notebook_div(plot)}\n",
-    "publish_display_data(data)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "from IPython.core.display import HTML\n",
-    "from bokeh.embed import notebook_div\n",
-    "HTML(notebook_div(plot))"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": [
-    "plot.html"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [],
-   "source": []
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Python 2",
-   "language": "python",
-   "name": "python2"
-  },
-  "language_info": {
-   "codemirror_mode": {
-    "name": "ipython",
-    "version": 2
-   },
-   "file_extension": ".py",
-   "mimetype": "text/x-python",
-   "name": "python",
-   "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython2",
-   "version": "2.7.9"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 0
-}