bokeh

how to change chart type based on user slection radion button in bokeh

扶醉桌前 提交于 2020-01-06 04:34:29
问题 enter image description here I want to change bokeh chart at run time when click on a radio button. Here is what I've tried till now: import numpy as np import pandas as pd from bokeh.core.properties import value from bokeh.models.widgets import Paragraph,PreText,RadioButtonGroup from bokeh.layouts import widgetbox from bokeh.models.widgets import CheckboxGroup, RadioGroup from bokeh.layouts import column, row from bokeh.models import ColumnDataSource,LabelSet,CustomJS,Row from bokeh.plotting

Python bokeh show only every second categorical ticker

微笑、不失礼 提交于 2020-01-06 03:51:06
问题 How can I set for a CategoricalAxis not to show every ticker but just every second or third one? Let say I have 20 categorics on x-axis . I tried this but it does not work: ticker = CategoricalTicker(desired_num_ticks=10) xaxis = CategoricalAxis(ticker=ticker) my_fig.add_layout(xaxis, 'above') It shows all my tickers :( EDIT: It would be great to show only every second label as well... Thank you! 来源: https://stackoverflow.com/questions/34949298/python-bokeh-show-only-every-second-categorical

Can't run Bokeh abstract rendering example - ValueError: No JSON could be decoded

*爱你&永不变心* 提交于 2020-01-05 18:04:54
问题 When I try to run the abstract rendering example in this way: python .\abstractrender.py I get this output: S C:\Anaconda\Examples\bokeh\plotting\server> python .\abstractrender.py Using saved session configuration for http://localhost:5006/ To override, pass 'load_from_config=False' to Session INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): localhost INFO:bokeh.session:got read write apikey Traceback (most recent call last): File ".\abstractrender.py", line 9,

python bokeh: get image from webcam and show it in dashboard

流过昼夜 提交于 2020-01-05 05:47:07
问题 I want to display a an image - e.g. capture with the webcam - in bokeh. I tried image_url and image_rgba, but both are not working. Image_url is showing nothing, image_rgb shows somethin, but there seems to be some index shif. # -*- coding: utf-8 -*- from bokeh.plotting import figure, show import scipy.misc import cv2 import matplotlib.pyplot as plt import os # capture video frame from webcam #vc = cv2.VideoCapture(1) vc = cv2.VideoCapture(-0) rval, frame = vc.read() vc.release() # show

Bokeh - Pandas not able to read bytesIO object of excel file from JS

十年热恋 提交于 2020-01-05 04:19:10
问题 I need your inputs on some challenges I'm facing since few days. My target is to have a upload button, from which I share .xlsx file with 2 sheets. Once I load this data and read it into pandas DataFrame , I perform some pythonic calculations/optimisation code etc and get few results(tabular summarised). Now based on the number of unique 'levels'/'groups' I will create that many tabs and then display this summarise results in each tab. Also have a general(common) plot in the main page. Below

Bokeh Python: Select dropdown is updating ColumnDataSource but not updating the graph

≡放荡痞女 提交于 2020-01-05 04:06:01
问题 I'm new to Bokeh and I'm trying to create an interactive plot of weather data. There are two Select menus, one for sensor ID (132, 133, ...), and one for variable (Temperature, Dew Point, ...). When the user changes either value, the graph is supposed to update with the selected data. The data I'm using is in a Panda Dataframe, where there is a column 'dt' which contains the one minute interval datetime objects, and the data are in columns that follow the naming convention 'Temp132', 'Temp

Bokeh image glyph displays image upside-down

梦想与她 提交于 2020-01-04 05:10:49
问题 Bokeh image glyph shows images upside-down and y-axis does not conform to standards of image display, where tick mark zero starts at the top (matrix-like notation). from scipy.misc import lena import bokeh.plotting as bp import matplotlib.pyplot as plt bp.output_notebook() %matplotlib inline lena_img = lena()/256.0 plt.figure(figsize=(10, 10)) plt.imshow(lena_img, cmap='gray') plt.show() f1 = bp.figure(plot_width=512, plot_height=512, x_range=[0, 512], y_range=[0, 512], logo='grey') f1.image

Python, Bokeh: How to change range of datetime axis

感情迁移 提交于 2020-01-03 19:41:11
问题 I would like to set the range of a datetime axis using a button. However, the command f.x_range = Range1d(start=start_date, end=end_date) doesn't work. When clicking the button nothing happens. I don't get any errors, neither in the terminal windows running the Bokeh server, nor in the console output of my Chrome web browser. You find the entire code below. I'm grateful for any advice. Thanks, Julian # Import libraries from bokeh.io import curdoc from bokeh.models import ColumnDataSource,

Python, Bokeh: How to change range of datetime axis

独自空忆成欢 提交于 2020-01-03 19:41:04
问题 I would like to set the range of a datetime axis using a button. However, the command f.x_range = Range1d(start=start_date, end=end_date) doesn't work. When clicking the button nothing happens. I don't get any errors, neither in the terminal windows running the Bokeh server, nor in the console output of my Chrome web browser. You find the entire code below. I'm grateful for any advice. Thanks, Julian # Import libraries from bokeh.io import curdoc from bokeh.models import ColumnDataSource,

How to setup custom css with bokeh serve

雨燕双飞 提交于 2020-01-03 18:33:04
问题 How to assign css proprties to a custom class assigned to a widget through css_classes if I'm serving my app through bokeh serve --show ? from bokeh.models import Button button = Button(label="Press Me", css_classes=['myclass']) curdoc().add_root(button) 回答1: If you dont mind using a html template, once you define your css classes, their styles can be set in a css file. (If you want to include the css styles from within python this answer wont help you) This can be included in the html