Questions tagged [bokeh]
Bokeh is a library for interactive visualization (including streaming or large datasets) that targets modern web browsers for presentation, and high level languages such as Python, Scala, and R for use.
4,485
questions
0
votes
0
answers
8
views
Use snapped location of bokeh hover tool in CustomJS event callback
In a Databricks notebook, I am plotting a curve using bokeh. I want the user to be able to hover their cursor over the graph, have it snap to the curve, and then - via mouse click - have the ability ...
2
votes
0
answers
13
views
Problem with update select widget and customJS bokeh for streamlit app
I have a problem with the customJS callback for a streamlit application.
The following code works to display the graph but the callback doesn't work and I don't practice JavaScript.
When I change the ...
0
votes
1
answer
10
views
Bokeh panel not printed when is inside an if-statement
I am using Bokeh to print out a multiple sequence alignment. So far, it has worked perfectly. For example:
[*Previous code that was not included*]
aln = AlignIO.read(alignment_file,'fasta')
p = ...
0
votes
0
answers
15
views
How to change size of child plots inside a gridplot in Bokeh
I'm plotting two standard Figure plots as a gridplot as follows.
curdoc().add_root(gridplot([[p], [p2]]))
How do I get figure p to be 3x as high as plot p2? I can set frame_height to be 3x bigger in ...
0
votes
0
answers
15
views
Count number data points from plot with bokeh box select
I am using the following code(example from bokeh page) to select data points from one plot with box select and copy them on a second plot.
In addition, I want to count the number of data points that ...
0
votes
0
answers
18
views
How to dynamically adjust y-axis zoom in Bokeh?
I'm trying to make it so mousewheel zoom only zooms the x-axis, and the y-axis will automatically rescale to fill available whitespace. Plot:
And then I zoom in, there is unwanted whitespace:
How do ...
0
votes
0
answers
23
views
Bokeh plot disappearing when panning or zooming
This simple Bokeh plot disappears when I try to pan or zoom with my mouse/mousewheel. The plotted line vanishes until I let go of my mouse, at which point it returns. How to fix?
from bokeh.plotting ...
0
votes
1
answer
21
views
Fix right-side of plot in place when zooming in/out
When I zoom out the following Bokeh plot:
A bunch of whitespace is added to both sides of the data:
How can I make it so that the right-hand side of the plot is fixed, so that zooming out will only ...
-1
votes
0
answers
17
views
Hvplot with django and netcdf
im working on a django project for visulisation of netcdf data , i use hvplot to plot the data and there is no interactivity , i want to know if possible how to make it possible.
the plot in browser
...
0
votes
1
answer
29
views
Bokeh: how to custom scale of ColorBar?
I make a figure (empty to simplify the code but I will add many elements), and a ColorBar to designate the color of different elements.
from bokeh.models import LinearColorMapper, ColorBar, ...
1
vote
2
answers
40
views
Bokeh colorbar, assign a tick to each color
I'm trying to plot an heatmap of a matrix containing some counts (called mat in my code, then df after change the structure to use it with Bokeh). The structure is like this:
X
element 1
element 2
...
0
votes
1
answer
32
views
custom function for scatterplot in bokeh not running
dataset i am working on:
https://www.kaggle.com/code/gauravsahani/housing-in-london-for-beginners/data
i am using bokeh and have produced the following scatter plot
source=ColumnDataSource(data=dict(...
1
vote
1
answer
22
views
custom bokeh charts function not running
d = {"Fruits" : ["Apples","Bananas","Pears","Oranges","Melons"],
"Ripe" : [10000,18000,19000,36000,50000],
"Rotten&...
0
votes
1
answer
46
views
Restrict users to access routes in flask
I am trying to create a flask app that will allow users to login, thereafter, they will be redirected to a specific dashboard created and being served with Bokeh.
So, for example, we have an user1, at ...
0
votes
1
answer
18
views
Bokeh: how to disable left mouse click scrolling?
A basic example of code with empty grid but it can be applied to all figures:
from bokeh.plotting import figure, show, output_file
output_file('test.html')
p = figure(x_range=(0,1), y_range=(0,1), ...
0
votes
0
answers
22
views
Visualization on a map (Bokeh)
I have the following columns that I would like to visualize in a map using Bokeh.
country cc geometry name
Fiji FJI MULTIPOLYGON (((180.00000 -16.06713, 180.00000... www.fae.com
United Republic ...
-1
votes
0
answers
10
views
interactive graph with export data to mysql or csv on wordpress
I want to create an interactive diagram on one of my WordPress subpages. Unfortunately, I am only proficient with Python, whereas my server does not support Python language.
I have found the Bokeh ...
0
votes
1
answer
19
views
How animation scatter plot with Matplotlib can be done with not superimposed data?
I want to do an animated scatter plot with one only pair of x,y data for each frame.
The code I wrote creates an animated scatter plot but the old dots appear in the plot, that means that new dots are ...
0
votes
1
answer
22
views
Bokeh HoverTool datetime formatter not working
My code for the bokeh HoverTool is the following:
p = figure(
plot_height=250,
x_axis_type='datetime',
)
p.vbar(x=data_df['date'].dt.to_pydatetime(), top=data_df['data'].values, ...
0
votes
1
answer
19
views
Bokeh: show text in heatmap cells
I make heatmap:
With this code:
import pandas as pd
from bokeh.models import BasicTicker, ColorBar, LinearColorMapper, PrintfTickFormatter, LabelSet
from bokeh.plotting import figure, show
df = pd....
0
votes
1
answer
25
views
How to colour code points using Bokeh with gmap
I currently have a gmap displaying gps points, however, I was hoping there was a way to colour code my GPS points based on which month they were recorded ? I have looked around online but am ...
0
votes
1
answer
12
views
How do I get the return-value of the callback in a periodic callback?
On a bokeh server, I use doc.add_periodic_callback(callback_fn, 1000). This returns the periodic callback ID and nothing else. Is it possible to access the value returned by callback_fn too?
0
votes
0
answers
34
views
How to get updated bokeh graph in streamlit (server issue?)
I want to embed a bokeh graphic in streamlit. the interactive bokeh graph is operational with the command boker serve --show application.
But when I integrate it into streamlit, I have the graph that ...
0
votes
0
answers
23
views
Bokeh Networkx Graph: Linking behaviors between the network and the DataTable
I built an interactive networkx graph using Bokeh which shows the correlations between medications and diseases.
Before I finalize the graph, I’m trying to link it to an interactive DataTable which ...
0
votes
0
answers
21
views
Plot multiple lines on a custom matplotlib/seaborn plot, and how to replicate in pandas-bokeh
I have a pandas dataframe that contains some data that has been collected. There is a sample name (of which in this example there is two), several dose levels, and three counts of each dose levels (...
0
votes
1
answer
21
views
Bokeh bold some text in title
Good day,
I am quite new to Bokeh and I'm making a few charts. I want to bold only part of the text in the title of the chart.
As an example, I want to take this:
"Number of schools in District ...
0
votes
0
answers
13
views
Bokeh Plots: Appending plots to existing file
I need to append plots based on different functions to same .HTML output file. I believe output_file is causing this to happen. How can I plot figures using multiple functions but to same file?
...
0
votes
0
answers
32
views
Initiate ipywidget from the start
I am trying to use this ipywidget to initiate a bokeh plot with a function, it works fine once the dropdown value is changed. It will load the function and show the plot as expected, although it needs ...
0
votes
0
answers
13
views
Bokeh Multichoice Onload Empty
I'm trying to implement a Bokeh multi-choice in my dashboard, and want to create a callback that starts the selection empty on the on-onload (I'm selecting from a large dataset and will want to user ...
1
vote
1
answer
28
views
Bokeh colorbar customisation
Good day,
I have the following colorbar for my Bokeh chart.
My code for the colorbar is as follows:
palette = brewer['Greys'][8]
palette = palette[::-1]
formatter = PrintfTickFormatter(format='%1.0f'...
0
votes
1
answer
33
views
hovertool displaying ??? for bokeh boxplot
dataset: https://github.com/rashida048/Datasets/blob/master/StudentsPerformance.csv
I am trying to implement the hovertool function to display the value for the "Total" (sum of the 3 score ...
0
votes
0
answers
13
views
Image is not getting displayed when using Bokeh image_url in standalone bokeh server
I have a function that generates WordCloud using the wordcloud library, the wordcloud is, in turn, is being saved as an image and read into the Bokeh figure object using image_url.
However, while ...
0
votes
1
answer
46
views
Is there a way to plot a histogram with given bin widths with Mathplotlib?
I have two lists given.
One, named "bin_edge", represents the lower and upper borders of 24 bins by 25 values. The second, named "counts", represents the according counts (=values) ...
0
votes
1
answer
16
views
How to use extra extra_x_ranges, extra_y_ranges with add_tile in bokeh
I want to use long/lat (EPSG:4326) coordinates in a bokeh plot and have a map in the Background.
I tried with the tile provider maps as suggested in bokeh: Mapping geo data.
But the format is in web ...
0
votes
1
answer
34
views
how can I create a single box plot?
dataset: https://github.com/rashida048/Datasets/blob/master/StudentsPerformance.csv
from bokeh.models import Range1d #used to set x and y limits #p.y_range=Range1d(120, 230)
def box_plot(df, vals, ...
0
votes
1
answer
55
views
Plot points in google map with python with google api
I'm trying to plot some points on a map, and when searching on the internet, I found [this][1] tutorial with Google Maps and Bokeh library. The problem is that, after doing all the steps to get a key ...
0
votes
1
answer
37
views
Bokeh callback function doesnt update scatterplot colors based on clusters
My intial plot works great and shows the colors of the intial 3 clusters. However, when I select a new k value with the silder widget, the new clusters are all colored grey.
import numpy as np
import ...
0
votes
1
answer
20
views
Python Bokeh set axis minimum only, without setting the whole range
It's nice that I don't have to specify the axis ranges when I want to do a quick and easy plot, and that Bokeh does it automatically (like every other plotting library), but is there to set an axis ...
0
votes
1
answer
38
views
Conditional coloring in bokeh vbar plots
Try to make a vbar plot with bokeh. Would like to set a condition for the fill color when the value exceeds a pre-set number. Say, red when greater than 5, else purple. Is this doable with bokeh?
Any ...
1
vote
1
answer
81
views
why doesn't bokeh boxplot appear?
table I am working on:
https://github.com/KeithGalli/pandas/blob/master/pokemon_data.csv
When I create a boxplot for the 'HP' column with 'Generation' as the category it works fine
code IMAGE OF ...
0
votes
1
answer
39
views
Conditional Colours for Holoviews Heatmap
Just wondering how I can create a custom colour scheme based on conditions for a holoviews heatmap. I have created a column for colours that are based on conditions within the data. However, when I ...
0
votes
0
answers
38
views
UnsetValueError while plotting WordCloud using bokeh package
Here is the code I am using to generate a word cloud using bokeh library in python. The current python, bokeh, and bokeh_wordcloud2 version(s) are 3.7.6, 1.4.0, and 0.9 respectively.
from bokeh.io ...
0
votes
1
answer
42
views
bokeh x-axis xticks rotation? [duplicate]
image of plot updated plot image(still looks off)
source = ColumnDataSource(data=dict(dt=df['Date/Time'],
temp=df['Temp (C)'],
...
-1
votes
0
answers
21
views
Bokeh line is 'disappearing' when mouse hover with Streamlit 1.7, bokeh 2.4.1
It is observed that on plotting line using bokeh, when I do hover on line using mouse, the line disappears
Can someone help please?
0
votes
1
answer
34
views
How to rotate xticks in pandas-bokeh
.plot_bokeh(kind='bar',x='Weather',stacked=True,***xticks=?????????***)
File ~\Anaconda3\lib\site-packages\pandas_bokeh\plot.py:658, in plot(df_in, x, y, kind, figsize, use_index, title, legend, logx,...
0
votes
1
answer
38
views
creating html output file with plot bokeh
as a very simple example when I want to export a visualisation to a html in bokeh i'd do something like this:
#importing bokeh
from bokeh.plotting import figure
from bokeh.io import output_file, show
...
0
votes
0
answers
17
views
Select widget to filter tabs in bokeh
Basically I have several dashboards for each year of a specific subject. It is not feasible to use select to filter an unique year as they have very different aspects/metrics, I thought that it would ...
0
votes
0
answers
23
views
bokeh not executing as it should due to different column lengths
#Plotting flower species
#Importing libraries
from bokeh.plotting import figure
from bokeh.io import output_file, show
from bokeh.sampledata.iris import flowers
from bokeh.models import Range1d, ...
0
votes
0
answers
17
views
Bokeh Plot: Overlay a plot and a Div to get a gradient background using Bokeh
Initial Goal
I have a candlestick plot in Bokeh that is essentially a clone of the MSFT candlesticks example but with my custom data.
All I want is a grey-black gradient background behind that plot.
...
0
votes
0
answers
23
views
Bokeh run time error, models must be owned by a single document
when trying to enter two datasource this error popped up.
RuntimeError: Models must be owned by only a single document, StringFormatter(id='1266', ...) is already in a doc
df_2 = pd.DataFrame({
'...