bokeh

Color points in scatter plot of Bokeh

淺唱寂寞╮ 提交于 2019-12-19 03:39:27
问题 I have the following simple pandas.DataFrame : df = pd.DataFrame( { "journey": ['ch1', 'ch2', 'ch2', 'ch1'], "cat": ['a', 'b', 'a', 'c'], "kpi1": [1,2,3,4], "kpi2": [4,3,2,1] } ) Which I plot as follows: import bokeh.plotting as bpl import bokeh.models as bmo bpl.output_notebook() source = bpl.ColumnDataSource.from_df(df) hover = bmo.HoverTool( tooltips=[ ("index", "@index"), ('journey', '@journey'), ("Cat", '@cat') ] ) p = bpl.figure(tools=[hover]) p.scatter( 'kpi1', 'kpi2', source=source)

Bokeh: Synchronizing hover tooltips in linked plots

隐身守侯 提交于 2019-12-19 03:24:17
问题 I have two linked plots. When hovering, I would like to have a tooltip appear in both plots. I already use the linked selection with great success, but now I want to link the tooltips also. Below is an example. The tooltip appears in the left plot. It would be great if I can have the corresponding tooltip appear in the right plot. The corresponding data point is the data point with the same ID. (There is a shared 3D column data source; each plot takes a different 2D view). Ps. I'll improve

Embedding Bokeh plot in Django website results in blank page with no error message

微笑、不失礼 提交于 2019-12-19 02:49:06
问题 I'm trying to embed a Bokeh plot into a Django site that has an upload button. I'm using the example given here as a starting point and then adding on the instructions on embedding from here. This is a follow-up on my question here as I now have a new problem. The plot just wont display when I go to the url associated with it, but there is no error message and the page loads. I used need-a-minimal-django-file-upload-example/for_django_1.8 and it works as intended when I navigate to the url

How to get a list of Bokeh widget events and attributes (which can be used to trigger a Python callback)

自闭症网瘾萝莉.ら 提交于 2019-12-18 16:59:54
问题 The real (general) question I am new to Bokeh and I am trying to build a plot which can be dynamically updated based on input provided by a widget. However, usage of Python callbacks is not thoroughly documented for most widgets and therefore I'm stuck. How can I know which widget method I should use to attach my callback? I can guess the available choices by probing the widgets attributes in an interactive console, but that's not elegant and I'm sure it's written somewhere in the

How to color rows and/or cells in a Bokeh DataTable?

a 夏天 提交于 2019-12-18 12:42:12
问题 Starting from Initial table , I need to highlight(color) elements as shown in either one of the table examples Ex. 1, Ex. 2, Ex. 3 . Any idea? 回答1: In case someone else might bump into the same need, here are some variants that I came up with. (Thanks to Bokeh team for hints!) Variant 1: Highlight the cell where column A > column B Code: from bokeh.io import output_notebook, show output_notebook() from random import randint from bokeh.io import output_file, show from bokeh.layouts import

Can I plot a colorbar for a bokeh heatmap?

时间秒杀一切 提交于 2019-12-18 12:28:17
问题 Does bokeh have a simple way to plot the colorbar for a heatmap? In this example it would be a strip illustrating how colors correspond to values. In matlab, its called a 'colorbar' and looks like this: 回答1: UPDATE: This is now much easier: see http://docs.bokeh.org/en/latest/docs/user_guide/annotations.html#color-bars I'm afraid I don't have a great answer, this should be easier in Bokeh. But I have done something like this manually before. Because I often want these off my plot, I make a

Can I plot a colorbar for a bokeh heatmap?

假如想象 提交于 2019-12-18 12:27:59
问题 Does bokeh have a simple way to plot the colorbar for a heatmap? In this example it would be a strip illustrating how colors correspond to values. In matlab, its called a 'colorbar' and looks like this: 回答1: UPDATE: This is now much easier: see http://docs.bokeh.org/en/latest/docs/user_guide/annotations.html#color-bars I'm afraid I don't have a great answer, this should be easier in Bokeh. But I have done something like this manually before. Because I often want these off my plot, I make a

bokeh DataTable with conditionally coloured cells

橙三吉。 提交于 2019-12-18 12:09:08
问题 I want to display a DataTable in bokeh, wich cells are either red or orange, according to the text content of the cell. For example, if the cell contains the word "error", then the cell is displayed in red background. If the cells contains the word "warning", then it's orange. I believe I should use [HTMLTemplateFormatter][1] , but how? How would I do that? Thanks 回答1: Looking through the documentation, you can use a HTMLTemplateFormatter and underscore js to format the table. See http://docs

Dynamically add/remove plot using 'bokeh serve' (bokeh 0.12.0)

拟墨画扇 提交于 2019-12-18 11:34:36
问题 My question is quite similar to another thread using bokeh 0.7.1, but the API for bokeh servers has changed enough in 0.12.0, that I am struggling to adapt that answer to the new version. To summarize, I have a page with a grid of timestream plots pulling data from a file that is continuously updated. The page has a MultiSelect menu that lists all the variables in my file. I want to be able to select different variables in the menu, press a button, and then have the plots of the existing

How to add a Callback to Bokeh DataTable?

百般思念 提交于 2019-12-18 11:29:01
问题 I am trying to use Bokeh to make an editable DataTable that updates the source data when the data is edited. I started with the standard DataTable example here, and make the editable kwarg to true. Here is where I am at: from datetime import date from random import randint from bokeh.models import ColumnDataSource, Callback from bokeh.models.widgets import DataTable, DateFormatter, TableColumn from bokeh.io import output_file, output_notebook, show, vform output_notebook() data = dict(dates=