from bokeh.plotting import * output_notebook() from numpy import * x = linspace(-6, 6, 100) y = cos(x) circle(x, y, color="red", plot_width=500, plot_height=500) show() from bokeh.sampledata.autompg import autompg grouped = autompg.groupby("yr") mpg = grouped["mpg"] avg = mpg.mean() std = mpg.std() years = asarray(grouped.groups.keys()) american = autompg[autompg["origin"]==1] japanese = autompg[autompg["origin"]==3] hold(True) figure() quad(left=years-0.4, right=years+0.4, bottom=avg-std, top=avg+std, fill_alpha=0.4) circle(x=asarray(japanese["yr"]), y=asarray(japanese["mpg"]), size=8, alpha=0.4, line_color="red", fill_color=None, line_width=2) triangle(x=asarray(american["yr"]), y=asarray(american["mpg"]), size=8, alpha=0.4, line_color="blue", fill_color=None, line_width=2) hold(False) show() output_notebook() source = ColumnDataSource(autompg.to_dict("list")) source.add(autompg["yr"], name="yr") plot_config = dict(plot_width=400, plot_height=400, tools="pan,wheel_zoom,box_zoom,select") gridplot([[ circle("yr", "mpg", color="blue", title="MPG by Year", source=source, **plot_config), circle("hp", "displ", color="green", title="HP vs. Displacement", source=source, **plot_config), circle("mpg", "displ", size="cyl", line_color="red", title="MPG vs. Displacement", fill_color=None, source=source, **plot_config) ]]) show() output_file("barplot.html") hold(True) figure() quad(left=years-0.4, right=years+0.4, bottom=avg-std, top=avg+std, fill_alpha=0.4) circle(x=asarray(japanese["yr"]), y=asarray(japanese["mpg"]), size=8, alpha=0.4, line_color="red", fill_color=None, line_width=2) triangle(x=asarray(american["yr"]), y=asarray(american["mpg"]), size=8, alpha=0.4, line_color="blue", fill_color=None, line_width=2) hold(False) show() output_notebook() # Set bokeh back to notebook output mode from IPython.display import IFrame IFrame("http://jsfiddle.net/3VNuN/4/embedded/result%2Cjs/", 800, 400)