bokeh

Background color of bokeh layout

血红的双手。 提交于 2021-02-18 12:11:20
问题 I'm playing around with the Bokeh sliders demo (source code here), and I'm trying to change the background color of the entire page. Though changing the color of the figure is easy using background_fill_color and border_fill_color , the rest of the layout still appears on top of a white background. Is there an attribute I can add to the theme that will allow me to set the color via curdoc().theme ? 回答1: There's not currently any Python property that would control the HTML background color.

Background color of bokeh layout

倖福魔咒の 提交于 2021-02-18 12:10:24
问题 I'm playing around with the Bokeh sliders demo (source code here), and I'm trying to change the background color of the entire page. Though changing the color of the figure is easy using background_fill_color and border_fill_color , the rest of the layout still appears on top of a white background. Is there an attribute I can add to the theme that will allow me to set the color via curdoc().theme ? 回答1: There's not currently any Python property that would control the HTML background color.

How can I add text annotation in Bokeh?

匆匆过客 提交于 2021-02-18 11:36:09
问题 I'm looking for Matplotlib type 1 text annotation in Bokeh, but I couldn't find it in the their user guide 2 or in the references. 回答1: As of version 0.12.2, to add text annotations you would use the "label" glyph. from bokeh.models import Label p = figure(...) mytext = Label(x=70, y=70, text='here your text') p.add_layout(mytext) show(p) Please find a full example in the documentation: http://docs.bokeh.org/en/latest/docs/user_guide/annotations.html#userguide-annotations 回答2: This 'text'

Customize edge color based on node selection Holoviews/Bokeh Chord diagram

旧时模样 提交于 2021-02-11 17:01:22
问题 I have created a holoviews chord plot where each node is associated with particular group(community). I have a requirement that whenever I tap on a particular node all the edge associated with it should be same color as the color of the node. For example in this chord diagram example chord If I select a blue node the edge color should be same as node color(i.e blue). But Here when I click on a blue node I am getting few edges of of blue and few edges of orange color(basically the edge takes

Filter data with Javascript callback in Python's Bokeh

会有一股神秘感。 提交于 2021-02-11 15:19:19
问题 apologies in advance for unprecise/unappreciated wording as this is my first question here. Feel free to point out how I can improve it in the future. I have been reading through all of Bokeh's user guide and various forums but belief this question is still insufficiently covered as it appears over and over again without an answer that can be applied generically. My task is to construct a scatterplot in Python's Bokeh that can interactively be filtered based on a categorical variable. My

Bokeh Slider Stacked Bar Chart

非 Y 不嫁゛ 提交于 2021-02-11 14:41:23
问题 I want to be able to only show the initial top 3 bars and then show more or less bars using the slider. I don't know if this is possible using the slider widget of bokeh or if there is a better method. from bokeh.models.widgets import Slider from bokeh.layouts import widgetbox, column from bokeh.models import CustomJS, Slider fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries'] years = ["2015", "2016", "2017"] colors = ["#c9d9d3", "#718dbf", "#e84d60"] data = {'fruits

Plots do not show with bokeh

99封情书 提交于 2021-02-11 14:15:57
问题 i am trying to export a report as HTML using Bokeh with python. Can anybody tell me, why my code is not working? I tried to print a simple Div and succeeded, but as soon as i include plots, the browser still opens, but nothing is visible. Is it not possible to inherit Figure? I reduced it to the relevant parts: def export_html(self): plots=[] plots.append(PlotObject(self.plot_attributes[4])) VisuLog(plots) from bokeh.plotting import Figure, show, output_file class VisuLog(): def __init__(self

How to add Arrow annotations with an offset to a bokeh plot with a datetime x-axis

断了今生、忘了曾经 提交于 2021-02-11 06:52:30
问题 I want to draw an arrow or dots when 2 ma cross each other like there will up arrow when short ma cross above long ma etc. but I don't know how to plot when it is datetime. I try to use this code and it just give me errors. #plot short ma and long ma p.line(df['Date'], df['short_ma'], color='red') p.line(df['Date'], df['long_ma'], color='black') p.add_layout(Arrow(end=VeeHead(size=35), line_color="red",x_start=df['Date'], y_start=df['crossabove']+5, x_end=df['Date'], y_end=df['Date'])) #the

Interactively change a point plot in bokeh using RangeSlider to select columns in a pandas dataframe

自闭症网瘾萝莉.ら 提交于 2021-02-10 20:31:40
问题 I have a pandas dataframe df where the first two columns represent x, y coordinates and the remaining columns represent time slices (t0,...tn) where the presence(1) or absence(0) of each point at each time slice (ti) is recorded. I would like to use a RangeSlider (not a Slider ) so that I can slide across a range of time slices and plot points that are present within that range. This is what I got thus far, from bokeh.layouts import column from bokeh.plotting import figure, show from bokeh

bokeh taptool selection colours

ぃ、小莉子 提交于 2021-02-10 18:00:02
问题 I am using the TapTool in bokeh to select some circles which I have drawn on top of a gmap . Currently, the selected circle is in the foreground and the rest fade into the map background. Is there a way to change this default behaviour? I would like, for example, to give a different colour boundary to the selected circle and keep the rest the same. Is there a way to change the rendering of the selected and unselected objects? 回答1: The Styling Visual Attributes chapter of the User's Guide has