# HG changeset patch # User Jeff Hammel # Date 1435895815 25200 # Node ID 4372fb852384403c432c610516f3b7a7ab74c009 # Parent 31a004976411968c242f0fd0e47f93337147f713 add example file diff -r 31a004976411 -r 4372fb852384 example/iris.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/iris.py Thu Jul 02 20:56:55 2015 -0700 @@ -0,0 +1,17 @@ +from bokeh.sampledata.iris import flowers +from bokeh.plotting import * + +output_file("iris.html", title="iris.py example") + +colormap = {'setosa': 'red', 'versicolor': 'green', 'virginica': 'blue'} + +flowers['color'] = flowers['species'].map(lambda x: colormap[x]) + +#setting the name kwarg will give this scatter plot a user +#friendly id, and the corresponding embed.js will have a nice name +#too + +scatter(flowers["petal_length"], flowers["petal_width"], + color=flowers["color"], fill_alpha=0.2, size=10, name="iris") + +show() \ No newline at end of file