Wednesday, December 21, 2016

Bokeh demo in python


In [5]:
from bokeh.plotting import figure, show, output_file
from bokeh.sampledata.iris import flowers
from bokeh.io import output_notebook

colormap = {'setosa': 'red', 'versicolor': 'green', 'virginica': 'blue'}
colors = [colormap[x] for x in flowers['species']]

output_notebook()
p = figure(title = "Iris Morphology")
p.xaxis.axis_label = 'Petal Length'
p.yaxis.axis_label = 'Petal Width'

p.circle(flowers["petal_length"], flowers["petal_width"],
         color=colors, fill_alpha=0.2, size=10)

#output_file("iris.html", title="iris.py example")

show(p)
Loading BokehJS ...
Out[5]:
<Bokeh Notebook handle for In[5]>
In [ ]:
 

No comments :

Post a Comment