bokeh

How to replace the legend in interactive Bokeh graph, rather than augment the legend?

南笙酒味 提交于 2021-01-29 02:46:59
问题 I am using a selection dropdown in Bokeh to change what the chart shows. I'd also like the chart's legend to change accordingly. However, what happens instead is the legend becomes augmented every time the user selects a new dropdown value. Eventually, the legend displays every value from every possible dropdown option simultaneously. How do I "clear" the old legend on every new dropdown select? import numpy as np import pandas as pd import os from bokeh.plotting import figure from bokeh.io

How to replace the legend in interactive Bokeh graph, rather than augment the legend?

微笑、不失礼 提交于 2021-01-29 02:45:17
问题 I am using a selection dropdown in Bokeh to change what the chart shows. I'd also like the chart's legend to change accordingly. However, what happens instead is the legend becomes augmented every time the user selects a new dropdown value. Eventually, the legend displays every value from every possible dropdown option simultaneously. How do I "clear" the old legend on every new dropdown select? import numpy as np import pandas as pd import os from bokeh.plotting import figure from bokeh.io

How to delete/add rows in Bokeh heatmap and maintain row height?

冷暖自知 提交于 2021-01-28 22:52:37
问题 I've made a Bokeh heatmap linked to a CheckBoxGroup, so that the active items in the CheckBoxGroup correspond to the rows displayed in the heatmap. i.e. checking/unchecking boxes in the CheckBoxGroup adds or deletes rows in the heatmap. It all works fine except that I would like the rows of the heatmap to stay the same height regardless of how many rows are in the heatmap. What actually happens is the original height of the heatmap is retained and the rows resize to fit the original height. I

How to delete/add rows in Bokeh heatmap and maintain row height?

谁说我不能喝 提交于 2021-01-28 22:29:09
问题 I've made a Bokeh heatmap linked to a CheckBoxGroup, so that the active items in the CheckBoxGroup correspond to the rows displayed in the heatmap. i.e. checking/unchecking boxes in the CheckBoxGroup adds or deletes rows in the heatmap. It all works fine except that I would like the rows of the heatmap to stay the same height regardless of how many rows are in the heatmap. What actually happens is the original height of the heatmap is retained and the rows resize to fit the original height. I

Bokeh Bar plot |

别说谁变了你拦得住时间么 提交于 2021-01-28 20:13:18
问题 I am trying to Create a bokeh bar chart using Python. The data2 is the values from bokeh.plotting import figure, output_file, show,hplot from bokeh.charts import Bar data2=[65.75, 48.400000000000006, 58.183333333333337, 14.516666666666666] bar = Bar(values=data2,xlabel="beef,pork,fowl,fish",ylabel="Avg consumtion", width=400) show(bar) Error TypeError: Bar() takes at least 1 argument (1 given) What am I doing wrong Here? 回答1: The bokeh.charts API (including Bar ) was deprecated and removed

Bokeh & Custom JS - Using a Slider to update a multiline graph

。_饼干妹妹 提交于 2021-01-28 08:11:15
问题 I am using Bokeh to produce an interactive time-series graph. There can be n number of series displayed simultaneously. Each series will display from t= 0 to t = x, with x being the value created by a slider. I'm using ColumnDataSource to contain it all, MultiLine glyph to display the series, Slider for the slider and CustomJS to control the update interaction. from bokeh.models import CustomJS, ColumnDataSource, Slider, Plot from bokeh.models.glyph import MultiLine from bokeh.io import show

bokeh server update axe scale

試著忘記壹切 提交于 2021-01-28 07:13:50
问题 When I try to change the y axis scale with a bokeh widget, nothing happens. Updating the x range however, does work. def make_document(doc): df = some_pandas_dataframe() x = range(len(df)) plot = figure(sizing_mode='scale_both') scatters = list() for l in labels: scatters.append(plot.step(x=x, y=df[l].sort_values(), alpha=0.2)) x_range_slider = RangeSlider(start=0, end=int(math.ceil(df.shape[0]/1000) * 1000), value=(0, df.shape[0]), step=1, title='Wer hat es geschafft? Der Joshua') p_layout =

Update a Bokeh Span with an interact element in Jupyter notebook

假装没事ソ 提交于 2021-01-28 04:03:46
问题 I am trying to make a span in bokeh using jupyter widgets. from ipywidgets import interact import numpy as np from scipy.stats import norm from bokeh.sampledata.daylight import daylight_warsaw_2013 from bokeh.io import push_notebook, show, output_notebook from bokeh.plotting import figure from bokeh.models import Span output_notebook() p = figure() x_axis = np.arange(-10, 10, 0.001) # Mean = 0, SD = 2. y_axis = norm.pdf(x_axis,0,2) p.line(x_axis, y_axis, line_dash='solid', line_width=2)

Update a Bokeh Span with an interact element in Jupyter notebook

房东的猫 提交于 2021-01-28 03:43:54
问题 I am trying to make a span in bokeh using jupyter widgets. from ipywidgets import interact import numpy as np from scipy.stats import norm from bokeh.sampledata.daylight import daylight_warsaw_2013 from bokeh.io import push_notebook, show, output_notebook from bokeh.plotting import figure from bokeh.models import Span output_notebook() p = figure() x_axis = np.arange(-10, 10, 0.001) # Mean = 0, SD = 2. y_axis = norm.pdf(x_axis,0,2) p.line(x_axis, y_axis, line_dash='solid', line_width=2)

Bokeh - Stacked and grouped charts

跟風遠走 提交于 2021-01-27 06:56:29
问题 Is it possible to create a plot in bokeh that is both stacked and grouped? Kinda like http://www.highcharts.com/demo/column-stacked-and-grouped/. The dataset is something like this count date class user 39 2016/12/28 4 user1 26 2016/12/28 4 user2 3 2016/12/28 4 user2 8 2016/12/28 4 user1 1 2016/12/28 4 user1 22 2016/12/28 4 user1 26 2016/12/28 4 user2 1 2016/12/28 4 user1 7 2016/12/28 4 user2 12 2016/12/28 4 user3 23 2016/12/28 4 user3 31 2016/12/28 4 user3 2 2016/12/31 4 user1 1 2016/12/31 4