Bokeh Cheat Sheet
Bokeh Cheat Sheet
Bokeh Cheat Sheet
fill_color='white')
Out side Plot Area
>>> p2.square(np.array([1.5,3.5,5.5]), [1,4,3],
Bokeh’s mid-level general purpose bokeh.plotting interface is centered Legend Background & Border
around two main components: data
and glyphs. Selection and Non-Selection Glyphs
>>> p = figure(tools='box_select')
>>> p.legend.border_line_color = "navy"
nonselection_alpha=0.1)
Rows & Columns Layout
Hover Glyphs
>>> from bokeh.models import HoverTool
Rows
>>> hover = HoverTool(tooltips=None, mode='vline')
>>> from bokeh.layouts import row
The basic steps to creating plots with the bokeh.plotting
interface are:
>>> p3.add_tools(hover) >>> layout = row(p1,p2,p3)
1. Prepare some data (Python lists, NumPy arrays, Pandas DataFrames and other sequences of values)
Columns
2. Create a new plot
color=dict(field='origin',
Grid Layout
>>> y = [6, 7, 2, 4, 5]
transform=color_mapper),
x_axis_label='x',
>>> row1 = [p1,p2]
y_axis_label='y')
>>> row2 = [p3]
Linked Brushing
>>> from bokeh.io import output_file, show
>>> p4 = figure(plot_width = 100, tools='box_select,lasso_select')
Components
>>> p5.circle('mpg', 'hp', source=cds_df)
SV G >>> save(layout)