bokeh

bokeh vbar_stack: positive values on positive side, negative values on negative side

bokeh vbar_stack: positive values on positive side, negative values on negative side Question: Example program import bokeh.colors import pandas as pd from bokeh.plotting import figure, show import bokeh.models import bokeh.palettes import bokeh.transform data = { ‘date’: [‘2024-04-15’, ‘2024-04-16’, ‘2024-04-17’ ], ‘Bill’: [1, 1, -1], ‘Note’: [1, -1, -1], ‘Bond’: [1, 0, -1] } df = …

Total answers: 1

how can i reference a specific rect in a Bokeh plot?

how can i reference a specific rect in a Bokeh plot? Question: I’m working on a plot with ornamentations that draw rectangles over the plot to highlight some sections. I’d like to find a reference for a rect that is plotted on top so that i can move it, unrelated to the data plotted. I …

Total answers: 1

How can I make a bar chart in Bokeh were positive/negative values have different colours?

How can I make a bar chart in Bokeh were positive/negative values have different colours? Question: In the below simple example code I have a bar chart with pos/neg values, how can I ammend the code to show green/red for pos/neg value bars? from bokeh.io import show from bokeh.plotting import figure fruits = [‘Apples’, ‘Pears’, …

Total answers: 1

How to save the multiple figures in a bokeh gridplot into separate png files?

How to save the multiple figures in a bokeh gridplot into separate png files? Question: I have a html file generated by bokeh gridplot containing multiple figures. My use case is: I eye-check each figure, zoom-in/out individually. Then, I want click a button to save all the figures into separate png files. So each png …

Total answers: 1

How to plot selected columns of a Pandas dataframe using Bokeh 2.4.3

How to plot selected columns of a Pandas dataframe using Bokeh 2.4.3 Question: For future visitors: My original question was closed as a duplicate, but the old ‘multiline’ function in the linked answer is depreciated years ago. I would like to plot a selection of pandas columns using bokeh, i.e. multiple lines in one chart. …

Total answers: 1

Bokeh ColumnDataSource Error when identifying as source – why?

Bokeh ColumnDataSource Error when identifying as source – why? Question: I’m getting error messages when identifying ColumnDataSource as my source, want to do it right. Let me show the errors. First, I generate some random data in a DataFrame and put it into the ColumnDataSource: col_list = [‘ob1′,’ob2′,’ob3′,’ob4′,’ob5’] df = pd.DataFrame(np.random.uniform(73.965,74.03,size=(25, 5)).astype(float), columns=col_list) df.reset_index(inplace=True) df …

Total answers: 1

Add Labels to Bokeh hbar

Add Labels to Bokeh hbar Question: How can I Label the bars in the hbar-plot with values? Is there a way to manipulate the values of the x-axis? To get rid of the negative numbers for example from bokeh.palettes import GnBu3, OrRd3 from bokeh.plotting import figure, show fruits = [‘Apples’, ‘Pears’, ‘Nectarines’, ‘Plums’, ‘Grapes’, ‘Strawberries’] …

Total answers: 1

Creating more than 4 stacked line charts with bokeh interactive legends

Creating more than 4 stacked line charts with bokeh interactive legends Question: I was consulting the bokeh user guide (link) on creating interactive legends (see subsection on "Hiding glyphs"). The code given allows me to create up to 4 stacked line charts. For example, if I try to create a fifth line chart ("AAP"): p …

Total answers: 1