How to use the bokeh.plotting.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 / styling_plot_outline_line_color.py View on Github external
from bokeh.plotting import figure, output_file, show

output_file("outline.html")

p = figure(plot_width=400, plot_height=400)
p.outline_line_width = 7
p.outline_line_alpha = 0.3
p.outline_line_color = "navy"

p.circle([1,2,3,4,5], [2,5,8,2,7], size=10)

show(p)
github anfederico / Gemini / gemini / engine.py View on Github external
y = self.account.equity[np.where(self.data['date'] == trade.date.strftime("%Y-%m-%d"))[0][0]]
                    if trade.type == 'long': p.circle(x, y, size=6, color='green', alpha=0.5)
                    elif trade.type == 'short': p.circle(x, y, size=6, color='red', alpha=0.5)
                except:
                    pass

            for trade in self.account.closed_trades:
                try:
                    x = time.mktime(trade.date.timetuple())*1000
                    y = self.account.equity[np.where(self.data['date'] == trade.date.strftime("%Y-%m-%d"))[0][0]]
                    if trade.type == 'long': p.circle(x, y, size=6, color='blue', alpha=0.5)
                    elif trade.type == 'short': p.circle(x, y, size=6, color='orange', alpha=0.5)
                except:
                    pass
        
        bokeh.plotting.show(p)
github andrewcooke / choochoo / py / ch2 / jupyter / template / some_activities.py View on Github external
s = session('-v2')
    maps = [map_thumbnail(100, 120, data)
            for data in (activity_statistics(s, SPHERICAL_MERCATOR_X, SPHERICAL_MERCATOR_Y,
                                             ACTIVE_DISTANCE, TOTAL_CLIMB,
                                             activity_journal=aj)
                         for aj in constrained_sources(s, constraint))
            if len(data[SPHERICAL_MERCATOR_X].dropna()) > 10]
    print(f'Found {len(maps)} activities')

    '''
    ## Display Maps
    '''

    output_notebook()
    show(htile(maps, 8))
github luca-fiorito-11 / sandy / sandy / sampling / plotter2.py View on Github external
("y", "@y")
            ]))

#    pratio.add_tools(HoverTool(tooltips=[
#        ('Name', '$name'),
#        ("E", "@x"),
#        ("y", "@y")
#        ]))

    pratio.legend.location = "top_left"
    pratio.legend.click_policy = "mute"



    layout = column(pmean, pstd, pratio)
    show(layout)
github bokeh / bokeh / examples / plotting / server / brewer.py View on Github external
areas[cat] = np.hstack((last[::-1], next))
        last = next
    return areas

areas = stacked(df, categories)

colors = brewer["Spectral"][len(areas)]

x2 = np.hstack((data['x'][::-1], data['x']))

output_server("brewer")

p = figure()
p.patches([x2 for a in areas], list(areas.values()), color=colors, alpha=0.8, line_color=None)

show(p)
github arviz-devs / arviz / arviz / plots / backends / bokeh / essplot.py View on Github external
line_dash="dashed",
            line_alpha=1.0,
        )

        ax_.renderers.append(hline)

        title = Title()
        title.text = make_label(var_name, selection)
        ax_.title = title

        ax_.xaxis.axis_label = "Total number of draws" if kind == "evolution" else "Quantile"
        ax_.yaxis.axis_label = ylabel.format("Relative ESS" if relative else "ESS")

    if backend_show(show):
        grid = gridplot(ax.tolist(), toolbar_location="above")
        bkp.show(grid)

    return ax
github bartvm / mimir / mimir / plot.py View on Github external
x_key : str
        The key in the serialized JSON object that contains the x-axis
        value.
    y_key : str
        See `x_key`.
    \*\*kwargs
        Connection parameters passed to the `connect` function.

    """
    subscriber, sequence, x, y = get_socket(x_key, y_key, **kwargs)
    output_notebook()

    fig = figure()
    plot = fig.line(x, y)

    handle = show(fig, notebook_handle=True)
    push_notebook(handle=handle)

    while True:
        update(x_key, y_key, sequence, subscriber, plot)
        push_notebook(handle=handle)
github bokeh / bokeh / sphinx / source / docs / user_guide / examples / concepts_plotting.py View on Github external
from bokeh.plotting import figure, output_file, show

# create a Figure object
p = figure(plot_width=300, plot_height=300, tools="pan,reset,save")

# add a Circle renderer to this figure
p.circle([1, 2.5, 3, 2], [2, 3, 1, 1.5], radius=0.3, alpha=0.5)

# specify how to output the plot(s)
output_file("foo.html")

# display the figure
show(p)
github nasa-jpl-memex / topic_space / topic_space / wordcloud_generator.py View on Github external
print df
    for word, coeff in df.iterrows():
        for n, c in enumerate(coeff):
            if c > 0:
                plot_sizes.append(c)
                plot_topics.append(str(n))
                plot_words.append(word)
    if len(plot_sizes) == 0:
        return
    max_size = np.max(plot_sizes)
    plot_sizes = [int(a/max_size * 75) + 25 for a in plot_sizes]

    print plot_sizes, plot_words, plot_topics

    p.circle(x=plot_topics, y=plot_words, size=plot_sizes, fill_alpha=0.6)
    plt.show(p)

    return plt.curplot()
github dask / distributed / distributed / bokeh / resource_monitor.py View on Github external
def _ipython_display_(self, **kwargs):
        show(self.figure)
        self.display_notebook = True