Multiple questions with Object-Oriented Bokeh [OBSOLETE]

I’m searching for the same answers (lack of documentation makes it difficult). In answer, to question #1, what is the utility of “extra_generated_classes”: tl;dr extra_generated_classes defines a modulename, classname, and parentname used in template generating js/html code, and extends the parent class passed into the app class (usually HBox or VBox in the examples). Longer … Read more

how to embed standalone bokeh graphs into django templates

Using the Embedding Bokeh Plots documentation example as suggested by Fabio Pliger, one can do this in Django: in the views.py file, we put: from django.shortcuts import render from bokeh.plotting import figure from bokeh.resources import CDN from bokeh.embed import components def simple_chart(request): plot = figure() plot.circle([1,2], [3,4]) script, div = components(plot, CDN) return render(request, “simple_chart.html”, … Read more

When plotting with Bokeh, how do you automatically cycle through a color pallette?

It is probably easiest to just get the list of colors and cycle it yourself using itertools: import numpy as np from bokeh.plotting import figure, output_file, show # select a palette from bokeh.palettes import Dark2_5 as palette # itertools handles the cycling import itertools output_file(‘bokeh_cycle_colors.html’) p = figure(width=400, height=400) x = np.linspace(0, 10) # create … Read more

In Bokeh, how do I add tooltips to a Timeseries chart (hover tool)?

Below is what I came up with. Its not pretty but it works. Im still new to Bokeh (& Python for that matter) so if anyone wants to suggest a better way to do this, please feel free. import pandas as pd import numpy as np from bokeh.charts import TimeSeries from bokeh.models import HoverTool from … Read more

Hide Axis in Bokeh

Create a figure object. So, in your example the figure object is p1, then p1.axis.visible = False If you want to specify a y or x axis, then use p1.xaxis.visible = False or p1.yaxis.visible = False

X and Y axis labels for Bokeh figure

As of Bokeh 0.11.1, the user’s guide section on axes now shows how to edit properties of existing axes. The way to do it is the same as before: p = figure(width=300, height=300, x_axis_label=”Initial xlabel”) p.xaxis.axis_label=”New xlabel”

tech