bokeh

How to make one slider/widget update multiple plots in Bokeh/Python/Pywidgets?

别等时光非礼了梦想. 提交于 2019-12-06 07:59:05
Using Jupyter notebook, how to have one slider interactively update two independent functions in two figures? There is a link to a similar question without answer here . Using Bokeh Javascript Callback slider power example , I tried adding a second set of variables x and y but keep using the same callback. The graphs do not update anymore. Any suggestions? I also was trying to do the same with Pywidget but did not get anywhere. I would prefer using IPywidget if there is a solution there. The end goal is to have a dashboard with an input composed of multiple slider, and an output composed of

How to convert a matplotlib.pyplot to a bokeh plot

与世无争的帅哥 提交于 2019-12-06 07:55:06
问题 I have been reading today about how to render a matplotlib.pyplot in a Django template. I found bokeh library and I was trying to convert my matplotib in a valid input to bokeh components. I read .to_boke method is deprecated . datos = np.random.randn(1000) ## Discretizamos el conjunto de valores en n intervalos, ## en este caso 8 intervalos datosbin = np.histogram(datos, bins=np.linspace(np.min(datos), np.max(datos), 9))[0] ## Los datos los queremos en tanto por ciento datosbin = datosbin *

Nominal/categorical axis on a scatter plot

落爺英雄遲暮 提交于 2019-12-06 06:51:24
How is it possible to generate a nominal/categorical axis (entries like a, b, c instead of 1,2,3 ) on a scatter plot in Bokeh? Imagine that the following data should be plotted: a 0.5 b 10.0 c 5.0 I tried the following: import bokeh.plotting as bk # output to static HTML file bk.output_file("scatter.html", title="scatter plot example") x = ['a', 'b', 'c'] y = [0.5, 10.0, 5.0] p = bk.figure(title = "scatter") p.circle(x = x, y = y) bk.show(p) However, this generates an empty plot. If the x data is changed to x = [1, 2, 3] everything gets plotted as expected. What can I do to have a, b, c on the

Bokeh - Do not show tooltip if it has missing value

拥有回忆 提交于 2019-12-06 05:47:36
I'm working on a bokeh figure that shows cluster activity. When a user hovers over a particular processor, I want it to show statistics about the processor. Heres the code: TOOLTIPS = [ ("Usage", "@{usage}%"), ("Name", "@name"), ("PID", "@pid"), ("Command", "@command"), ("User", "@user"), ] p = figure(title="Cluster Activity", plot_width=1200, plot_height=700, x_range=nodes, y_range=list(reversed(cores)), tools='hover', toolbar_location=None, tooltips=TOOLTIPS ) This works, but I don't want to show tooltips with a value of None. For example, if a particular processor, has a None value for User

Bokeh, zoom only on single axis, adjust another axis accordingly

a 夏天 提交于 2019-12-06 05:23:49
How can one make bokeh use zoom only on one axis and automatically scale objects, so they take exactly the space given and add some padding on extreme points off zoom-able axis parallels, while rendering empty space out of scope? In other words (or "madskills" to be exact): Example plot . This is most widely used for stocks plotting, so consider I want to copy zoom behavior of https://www.tradingview.com/chart/?symbol=FX:XAUUSD with Bokeh. Thank you in advance. Zoom on X axis only by using 'xwheel_zoom' tool: from bokeh.plotting import figure fig = figure(tools='xwheel_zoom', active_scroll=

Bokeh widget callback to select all checkboxes

我的未来我决定 提交于 2019-12-06 03:22:45
I have run into a couple problems in trying to setup a Bokeh CheckboxGroup widget. The Checkbox group it self is large (50 states) and I would like to initialize the selection as all active. Also (and more importantly) since this group is intended to be highly interactive, I would like to add buttons to "Select All" and "Clear All". I understand that I will need some callback mechanism to do this, but after searching the examples, documentation and stackoverflow, was not able to figure out just how. I include a simplified version of my code below. My preference is to use the standard widget

DARPA出手, Python有望成为大数据分析语言

我们两清 提交于 2019-12-06 02:39:45
当前, 在大数据领域, Java成为了当仁不让的必修语言。原因就是大数据平台必备的Hadoop分布式管理平台需要使用Java,但是这种局面有可能被DARPA改变。 IT经理网在“ 大数据成为美国军队的’新型武器’ ” 一文中,报道过美国国防部下属的“国防高级研究项目署”(DARPA)通过XDATA项目进行大数据投资的情况。 最近, DARPA通过XDATA项目的基金投资Continuum Analytics,帮助其开发Python在大数据领域的数据处理和可视化能力。 XDATA这个计划的目的, 就是研究在对非完美及非完整数据集,进行海量数据处理和数据可视化的算法。 XDATA项目基金总共有1亿美元, 这次DARPA对Continuum Analytics的投资共计3百万美元。 Python是一个非常流行的编程语言, 无论在网络程序员中(比如Google的相当多的产品就是用Python编写的,Python也是豆瓣的主要开发语言), 还是在科学计算领域, Python都有很广泛的应用。而Continuum Analytics的目的, 就是要进行下一代数据分析工具的开发, 使得Python在数据分析领域的应用, 如同在科学, 工程和规模化计算方面那样强大。 Continuum Analytics的旗舰产品 Anaconda 是一个基于Disco平台的数据管理,分析和可视化的工具。而

How to set properties of selected/unselected glyphs in bokeh

纵饮孤独 提交于 2019-12-06 02:38:14
问题 I have a dataset consisting of timeseries of a few observables, and I'd like to use bokeh to look at the phase diagram at different points in the time series. What I want to know is how to change the properties of the selected or unselected glyphs (in this case I'd like to reduce the alpha of the unselected points or change the color of the selected ones). The code below creates the interface I want in an ipython notebook, and is based on the example in the users guidehttp://docs.bokeh.org/en

Efficient updates of image plots in Bokeh for interactive visualization

筅森魡賤 提交于 2019-12-06 02:02:34
问题 I'm trying to create a smooth interactive visualization of different slices of a muldimensional array using Bokeh. The data in the slices changes according to the user interaction and thus has to be updated several times per second. I have written a Bokeh app with several small image plots (64x64 values) to show the contents of the slices, and a callback to update the ColumnDataSources when the user interacts with the app. Everything works as expected but I can't get more than 2 or 3 frames

Sliding through images with Bokeh Slider

有些话、适合烂在心里 提交于 2019-12-06 01:51:20
I am trying to convey a large amount of scientific data seamlessly with the help of sliders. I am beginning with Bokeh and have close to no knowledge in javascript. I tried to setup a first approach to be able to slide through two images, but I cannot get the image to refresh. Suppose I have 1.png and 2.png in my folder. from bokeh.io import vform from bokeh.models import CustomJS, ColumnDataSource, Slider from bokeh.plotting import Figure, output_file, show output_file('image.html') source = ColumnDataSource(data=dict(url=['1.png'])) p = Figure(x_range=(0,1), y_range=(0,1)) callbackimg =