How to use the bokeh.io.show function in bokeh

To help you get started, we’ve selected a few bokeh examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bokeh / bokeh / sphinx / source / docs / user_guide / examples / categorical_bar_pandas_groupby_colormapped.py View on Github external
cyl_cmap = factor_cmap('cyl', palette=Spectral5, factors=sorted(df.cyl.unique()))

p = figure(plot_height=350, x_range=group, title="MPG by # Cylinders",
           toolbar_location=None, tools="")

p.vbar(x='cyl', top='mpg_mean', width=1, source=source,
       line_color=cyl_cmap, fill_color=cyl_cmap)

p.y_range.start = 0
p.xgrid.grid_line_color = None
p.xaxis.axis_label = "some stuff"
p.xaxis.major_label_orientation = 1.2
p.outline_line_color = None

show(p)
github bokeh / bokeh / examples / reference / models / Diamond.py View on Github external
glyph = Diamond(x="x", y="y", size="sizes", line_color="#1c9099", line_width=2, fill_color=None)
plot.add_glyph(source, glyph)

xaxis = LinearAxis()
plot.add_layout(xaxis, 'below')

yaxis = LinearAxis()
plot.add_layout(yaxis, 'left')

plot.add_layout(Grid(dimension=0, ticker=xaxis.ticker))
plot.add_layout(Grid(dimension=1, ticker=yaxis.ticker))

curdoc().add_root(plot)

show(plot)
github hgt312 / NumpyXBench / NumpyXBench / tools.py View on Github external
title=title, y_axis_label="Speedup",
               tooltips=tooltips,
               toolbar_location="right")
    p.vbar(x='x', top='rates', source=source, width=0.9, bottom=offset, line_color="white",
           fill_color=factor_cmap('x', palette=palette, factors=backends, start=1, end=2))
    p.y_range.start = offset
    p.x_range.range_padding = 0.1
    p.xaxis.major_label_orientation = 1
    p.xgrid.grid_line_color = None
    if mode == "file":
        with open(filename, mode='w') as f:
            script, div = components(p)
            f.write(script)
            f.write(div)
    else:
        show(p)
github bokeh / bokeh / examples / reference / models / Line.py View on Github external
glyph = Line(x="x", y="y", line_color="#f46d43", line_width=6, line_alpha=0.6)
plot.add_glyph(source, glyph)

xaxis = LinearAxis()
plot.add_layout(xaxis, 'below')

yaxis = LinearAxis()
plot.add_layout(yaxis, 'left')

plot.add_layout(Grid(dimension=0, ticker=xaxis.ticker))
plot.add_layout(Grid(dimension=1, ticker=yaxis.ticker))

curdoc().add_root(plot)

show(plot)
github informatics-lab / forest / bokeh_apps / plot_sea_model_and_gpm_mpl / main.py View on Github external
init_fcast_time,
                                                 [plot_obj_left, plot_obj_right],
                                                 [bokeh_img_left, bokeh_img_right],
                                                 stats_list)

    try:
        bokeh_mode = os.environ['BOKEH_MODE']
    except:
        bokeh_mode = 'server'

    if bokeh_mode == 'server':
        bokeh.plotting.curdoc().add_root(control1.main_layout)
        bokeh.plotting.curdoc().title = 'Model rainfall vs GPM app'

    elif bokeh_mode == 'cli':
        bokeh.io.show(control1.main_layout)
github bokeh / bokeh / examples / reference / models / Patch.py View on Github external
glyph = Patch(x="x", y="y", fill_color="#a6cee3")
plot.add_glyph(source, glyph)

xaxis = LinearAxis()
plot.add_layout(xaxis, 'below')

yaxis = LinearAxis()
plot.add_layout(yaxis, 'left')

plot.add_layout(Grid(dimension=0, ticker=xaxis.ticker))
plot.add_layout(Grid(dimension=1, ticker=yaxis.ticker))

curdoc().add_root(plot)

show(plot)
github jaantollander / crowddynamics / crowddynamics / visualizations.py View on Github external
add_geom(p, target,
                 legend='target_{}'.format(i),
                 alpha=0.8,
                 line_width=3.0,
                 line_dash='dashed',
                 color='olive',)

    add_geom(p, field.obstacles,
             legend='obstacles',
             line_width=3.0,
             alpha=0.8, )

    p.legend.location = "top_left"
    p.legend.click_policy = "hide"

    bokeh.io.show(p)
github bokeh / bokeh / examples / reference / models / VArea.py View on Github external
glyph = VArea(x="x", y1="y1", y2="y2", fill_color="#f46d43")
plot.add_glyph(source, glyph)

xaxis = LinearAxis()
plot.add_layout(xaxis, 'below')

yaxis = LinearAxis()
plot.add_layout(yaxis, 'left')

plot.add_layout(Grid(dimension=0, ticker=xaxis.ticker))
plot.add_layout(Grid(dimension=1, ticker=yaxis.ticker))

curdoc().add_root(plot)

show(plot)
github bokeh / bokeh / examples / plotting / file / bar_intervals.py View on Github external
output_file("bar_intervals.html")

sprint.Year = sprint.Year.astype(str)
group = sprint.groupby('Year')
source = ColumnDataSource(group)

p = figure(y_range=group, x_range=(9.5,12.7), plot_width=400, plot_height=550, toolbar_location=None,
           title="Time Spreads for Sprint Medalists (by Year)")
p.hbar(y="Year", left='Time_min', right='Time_max', height=0.4, source=source)

p.ygrid.grid_line_color = None
p.xaxis.axis_label = "Time (seconds)"
p.outline_line_color = None

show(p)
github microsoft / msticpy / msticpy / nbtools / process_tree.py View on Github external
range_tool = _create_vert_range_tool(
        data=source,
        min_y=0,
        max_y=n_rows,
        plot_range=b_plot.y_range,
        width=90,
        height=plot_height,
        x_col="Level",
        y_col="Row",
        fill_map=fill_map,
    )
    plot_elems = row(b_plot, range_tool)
    if show_table:
        data_table = _create_data_table(source, schema, legend_col)
        plot_elems = column(plot_elems, data_table)
    show(plot_elems)
    return b_plot, plot_elems