# coding: utf-8 # In[ ]: from bokeh.charts import BoxPlot, output_notebook, show, defaults from bokeh.sampledata.autompg import autompg as df # In[ ]: output_notebook() # In[ ]: defaults.width = 450 defaults.height = 350 # In[ ]: box_plot = BoxPlot(df, label='cyl', values='mpg', title="label='cyl', values='mpg'") show(box_plot) # In[ ]: box_plot2 = BoxPlot(df, label=['cyl', 'origin'], values='mpg', title="label=['cyl', 'origin'], values='mpg'") show(box_plot2) # In[ ]: box_plot3 = BoxPlot(df, label='cyl', values='mpg', color='cyl', title="label='cyl' values='mpg'") show(box_plot3) # In[ ]: # use constant fill color box_plot4 = BoxPlot(df, label='cyl', values='displ', title="label='cyl' color='blue'", color='blue') show(box_plot4) # In[ ]: # color by one dimension and label by two dimensions box_plot5 = BoxPlot(df, label=['cyl', 'origin'], values='mpg', title="label=['cyl', 'origin'] color='cyl'", color='cyl') show(box_plot5) # In[ ]: # specify custom marker for outliers box_plot6 = BoxPlot(df, label='cyl', values='mpg', marker='cross', title="label='cyl', values='mpg', marker='cross'") show(box_plot6) # In[ ]: # color whisker by cylinder box_plot7 = BoxPlot(df, label='cyl', values='mpg', whisker_color='cyl', title="label='cyl', values='mpg', whisker_color='cyl'") show(box_plot7) # In[ ]: # remove outliers box_plot8 = BoxPlot(df, label='cyl', values='mpg', outliers=False, title="label='cyl', values='mpg', outliers=False") show(box_plot8)