Mercurial > hg > numerics
view example/iris.py @ 175:c4a5adc2d8f2
more sample data...cant get enough
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Thu, 10 Mar 2016 12:32:40 -0800 |
parents | 4372fb852384 |
children |
line wrap: on
line source
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()