from bokeh.sampledata.iris import flowers
from bokeh.plotting import figure, show, output_file
output_file("gfg.html")
graph = figure(title="Iris Visualization")
graph.xaxis.axis_label = "Length (in cm)"
graph.yaxis.axis_label = "Width (in cm)"
x = flowers[flowers["species"] == "setosa"]["petal_length"]
y = flowers[flowers["species"] == "setosa"]["petal_width"]
marker = "circle_cross"
line_color = "blue"
fill_color = "lightblue"
fill_alpha = 0.4
size = 10
legend_label = "setosa petals"
graph.scatter(x, y,
marker=marker,
line_color=line_color,
fill_color=fill_color,
fill_alpha=fill_alpha,
size=size,
legend_label=legend_label)
x = flowers[flowers["species"] == "setosa"]["sepal_length"]
y = flowers[flowers["species"] == "setosa"]["sepal_width"]
marker = "square_cross"
line_color = "blue"
fill_color = "lightblue"
fill_alpha = 0.4
size = 10
legend_label = "setosa sepals"
graph.scatter(x, y,
marker=marker,
line_color=line_color,
fill_color=fill_color,
fill_alpha=fill_alpha,
size=size,
legend_label=legend_label)
x = flowers[flowers["species"] == "versicolor"]["petal_length"]
y = flowers[flowers["species"] == "versicolor"]["petal_width"]
marker = "circle_cross"
line_color = "yellow"
fill_color = "lightyellow"
fill_alpha = 0.4
size = 10
legend_label = "versicolor petals"
graph.scatter(x, y,
marker=marker,
line_color=line_color,
fill_color=fill_color,
fill_alpha=fill_alpha,
size=size,
legend_label=legend_label)
x = flowers[flowers["species"] == "versicolor"]["sepal_length"]
y = flowers[flowers["species"] == "versicolor"]["sepal_width"]
marker = "square_cross"
line_color = "yellow"
fill_color = "lightyellow"
fill_alpha = 0.4
size = 10
legend_label = "versicolor sepals"
graph.scatter(x, y,
marker=marker,
line_color=line_color,
fill_color=fill_color,
fill_alpha=fill_alpha,
size=size,
legend_label=legend_label)
x = flowers[flowers["species"] == "virginica"]["petal_length"]
y = flowers[flowers["species"] == "virginica"]["petal_width"]
marker = "circle_cross"
line_color = "red"
fill_color = "lightcoral"
fill_alpha = 0.4
size = 10
legend_label = "virginica petals"
graph.scatter(x, y,
marker=marker,
line_color=line_color,
fill_color=fill_color,
fill_alpha=fill_alpha,
size=size,
legend_label=legend_label)
x = flowers[flowers["species"] == "virginica"]["sepal_length"]
y = flowers[flowers["species"] == "virginica"]["sepal_width"]
marker = "square_cross"
line_color = "red"
fill_color = "lightcoral"
fill_alpha = 0.4
size = 10
legend_label = "virginica sepals"
graph.scatter(x, y,
marker=marker,
line_color=line_color,
fill_color=fill_color,
fill_alpha=fill_alpha,
size=size,
legend_label=legend_label)
graph.legend.location = "top_left"
show(graph)