bokeh

Selectively show text in Bokeh plot based on zoom level

早过忘川 提交于 2021-02-08 11:27:29
问题 I am currently using Bokeh to plot some biological sequence data. Part of the plot involves displaying some text (amino acid residues) just above the x-axis, aligned with the numbers on the axis. When the user zooms in, they are then able to inspect the amino acid sequence (represented by single letters) that accompanies the data. However, when zoomed out, these letters merge together, and look quite messy. Is there any way to selectively plot/show glyphs depending on the zoom level? Many

How to achieve a responsive dashboard layout?

家住魔仙堡 提交于 2021-02-08 10:12:58
问题 I am working on a dashboard with a responsive map in the center that should take most available space ( stretch_both ) and two performance plots on either side with fixed width and a stretching height. Below the map is a slider that should have default height but stretch to the width of the map. Finally there is a button that should take a corner space and be of fixed size to avoid looking awkward. Here is the design: Here is a minimal not working example of a directory app: from bokeh.models

How to achieve a responsive dashboard layout?

坚强是说给别人听的谎言 提交于 2021-02-08 10:11:20
问题 I am working on a dashboard with a responsive map in the center that should take most available space ( stretch_both ) and two performance plots on either side with fixed width and a stretching height. Below the map is a slider that should have default height but stretch to the width of the map. Finally there is a button that should take a corner space and be of fixed size to avoid looking awkward. Here is the design: Here is a minimal not working example of a directory app: from bokeh.models

How to achieve a responsive dashboard layout?

北慕城南 提交于 2021-02-08 10:11:14
问题 I am working on a dashboard with a responsive map in the center that should take most available space ( stretch_both ) and two performance plots on either side with fixed width and a stretching height. Below the map is a slider that should have default height but stretch to the width of the map. Finally there is a button that should take a corner space and be of fixed size to avoid looking awkward. Here is the design: Here is a minimal not working example of a directory app: from bokeh.models

Bokeh: Generating graphs in a loop, the output graph's file sizes keep increasing

我与影子孤独终老i 提交于 2021-02-08 10:00:35
问题 I'm using bokeh to plot 100 graph files in a loop. for k in files: # Read the log file data into a df. log_file_name = str(k) + ".csv" logged_data = pd.read_csv("csv/"+log_file_name, parse_dates=["dttm_utc"], date_parser=dateparse) new_logged_data = logged_data.set_index("dttm_utc") mean_data = new_logged_data.resample("3D", how=[np.mean]) # Extract the energy values and time stamps out into two ds. energy_data = mean_data["value"]["mean"] time_data = mean_data.index # Plotting output_file(

Bokeh: Generating graphs in a loop, the output graph's file sizes keep increasing

一曲冷凌霜 提交于 2021-02-08 09:59:12
问题 I'm using bokeh to plot 100 graph files in a loop. for k in files: # Read the log file data into a df. log_file_name = str(k) + ".csv" logged_data = pd.read_csv("csv/"+log_file_name, parse_dates=["dttm_utc"], date_parser=dateparse) new_logged_data = logged_data.set_index("dttm_utc") mean_data = new_logged_data.resample("3D", how=[np.mean]) # Extract the energy values and time stamps out into two ds. energy_data = mean_data["value"]["mean"] time_data = mean_data.index # Plotting output_file(

Change style of tabs in bokeh plot

放肆的年华 提交于 2021-02-08 05:32:07
问题 I would like to know if there is a way to change the properties of tabs produced on a bokeh plot. Changes like increasing the text font, changing the tab width and so on. The following is a simple code for producing a plot with two tabs. from bokeh.models.widgets import Panel, Tabs from bokeh.io import output_file, show from bokeh.plotting import figure output_file("slider.html") p1 = figure(plot_width=300, plot_height=300) p1.circle([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=20, color="navy",

Add custom legend to bokeh Bar

别等时光非礼了梦想. 提交于 2021-02-07 19:59:37
问题 I have pandas series as: >>> etypes 0 6271 1 6379 2 399 3 110 4 4184 5 1987 And I want to draw Bar chart in Bokeh: p = Bar(etypes) . However for legend I get just etypes index number, which I tried to decrypt with this dictionary: legend = { 0: 'type_1', 1: 'type_2', 2: 'type_3', 3: 'type_4', 4: 'type_5', 5: 'type_6', } by passing it to label argument: p = Bar(etypes, label=legend) , but it didn't work. Also passing the list(legend.values()) does not work. Any ideas how to add custom legend

Add custom legend to bokeh Bar

送分小仙女□ 提交于 2021-02-07 19:56:35
问题 I have pandas series as: >>> etypes 0 6271 1 6379 2 399 3 110 4 4184 5 1987 And I want to draw Bar chart in Bokeh: p = Bar(etypes) . However for legend I get just etypes index number, which I tried to decrypt with this dictionary: legend = { 0: 'type_1', 1: 'type_2', 2: 'type_3', 3: 'type_4', 4: 'type_5', 5: 'type_6', } by passing it to label argument: p = Bar(etypes, label=legend) , but it didn't work. Also passing the list(legend.values()) does not work. Any ideas how to add custom legend

How to configure bokeh plot to have responsive width and fixed height

百般思念 提交于 2021-02-07 18:16:36
问题 I use bokeh embedded via the components function. Acutally I use : plot.sizing_mode = "scale_width" Which scales according to the width and maintains the aspect ratio. But I would like to have a responsive width but a fixed or maximum height. How is that possible to achieve? 回答1: There are stretch_both and scale_both options. How the item being displayed should size itself. Possible values are "fixed", "scale_width", "scale_height", "scale_both", and "stretch_both". "stretch_both" elements