bokeh

How to get interactive bokeh in Jupyter notebook

五迷三道 提交于 2020-03-17 06:45:11
问题 I'm gearing up towards using bokeh for an interactive online implementation of some python models I've written. Step 1 is understanding some basic interactive examples, but I can't get the introductory examples running INTERACTIVELY in a Jupyter notebook. I'm hoping someone can correct my misunderstanding of what is a copy-paste of bokeh's own example code. I'm aware that the Bokeh documentation isn't perfect (I fixed an outdated reference to bokeh.plotting.show rather than io.show ), but I

bokeh button callback only partially working

对着背影说爱祢 提交于 2020-03-05 04:49:30
问题 I am plotting a complex interactive donut chart in bokeh. The code below is a simplification of a component of this chart. I have a function which compiles a dataframe of data for the donut, and then converts it to a CDS. This data is then plotted as annular wedges. A radiobutton group should trigger a switch to a different dataframe (as CDS), and replot the annular wedge glyphs. The example provide (for Jupyter Lab) works in one direction. When initially plotted the button.active == 0 (outer

bokeh button callback only partially working

≡放荡痞女 提交于 2020-03-05 04:49:27
问题 I am plotting a complex interactive donut chart in bokeh. The code below is a simplification of a component of this chart. I have a function which compiles a dataframe of data for the donut, and then converts it to a CDS. This data is then plotted as annular wedges. A radiobutton group should trigger a switch to a different dataframe (as CDS), and replot the annular wedge glyphs. The example provide (for Jupyter Lab) works in one direction. When initially plotted the button.active == 0 (outer

bokeh button callback only partially working

柔情痞子 提交于 2020-03-05 04:49:03
问题 I am plotting a complex interactive donut chart in bokeh. The code below is a simplification of a component of this chart. I have a function which compiles a dataframe of data for the donut, and then converts it to a CDS. This data is then plotted as annular wedges. A radiobutton group should trigger a switch to a different dataframe (as CDS), and replot the annular wedge glyphs. The example provide (for Jupyter Lab) works in one direction. When initially plotted the button.active == 0 (outer

Add text annotations to each data point in Holoviews plot

偶尔善良 提交于 2020-03-03 12:33:59
问题 In Bokeh I am able to add a text annotation to each point in my plot programmatically by using LabelSet . Below I give an example for a simple bar plot: import numpy as np import pandas as pd # Make some data dat = \ (pd.DataFrame({'team':['a','b','c'], 'n_people':[10,5,12]}) .assign(n_people_percent = lambda x: (x['n_people']/np.sum(x['n_people'])*100) .round(1).astype('string') + '%') ) dat # Bar plot with text annotations for every bar from bkcharts import show, Bar from bkcharts

How to do linked data selections in HoloViews with Datashader + Bokeh backend

丶灬走出姿态 提交于 2020-03-02 08:45:53
问题 Let me just start by complementing the HoloViews developers, this thing is pretty amazing. There are just a lot of pieces and it is a bit hard to figure out how to put them all together to do what I want:). I am trying here to do linked multidimensional data plotting, i.e. I want to have several plots showing views of the same data along various dimensions. I want then to harness the Bokeh selection tools to select data in one of the plots, and see where it is in the others. But I also need

干货 | 一文带你搞定Python 数据可视化

…衆ロ難τιáo~ 提交于 2020-02-29 16:42:09
01 前言 在之前的一篇文章《Python 数据可视化利器》中,我写了 Bokeh、pyecharts 的用法,但是有一个挺强大的库 Plotly 没写,主要是我看到它的教程都是在 Jupyter Notebooks 中使用,说来也奇怪,硬是找不到如何本地使用(就是本地输出 HTML 文件),所以不敢写出来。现在已经找到方法了,这里我就在原文的基础上增加了 Plotly 的部分教程。 数据可视化的第三方库挺多的,这里我主要推荐两个,分别是 Bokeh、pyecharts。 02 推荐 数据可视化的库有挺多的,这里推荐几个比较常用的: ● Matplotlib ● Plotly ● Seaborn ● Ggplot ● Bokeh ● Pyechart ● Pygal 03 Plotly Plotly 文档地址: ● https://plot.ly/python/#financial-charts 来源: oschina 链接: https://my.oschina.net/u/3611008/blog/2353967

Manually change x range for Bokeh plot

好久不见. 提交于 2020-02-29 03:41:10
问题 So I'm trying to create a Bokeh plot for which I would like to be able to manually adapt the range of the X-Axis with a slider. Being a newbie I've only managed to get this far and despite researching this subject I haven't been able to solve this problem. Here my code: from bokeh.layouts import column from bokeh.models import CustomJS, ColumnDataSource, Slider from bokeh.plotting import Figure, output_file, show output_file("test.html") x = [x*0.5 for x in range(0, 200)] y = x source =

How can I set the x-axis as datetimes on a bokeh plot?

冷暖自知 提交于 2020-02-26 06:48:30
问题 I'm using bokeh with an ipython notebook. I want to plot a line graph in bokeh using a pandas DataFrame containing datetimes: import pandas as pd from datetime import datetime as dt from bokeh.io import output_notebook from bokeh.charts import Bar, Line, show df = pd.DataFrame(data=[1,2,3], index=[dt(2015, 1, 1), dt(2015, 1, 2), dt(2015, 1, 3)], columns=['foo']) output_notebook() show(Line(df)) However, bokeh uses microseconds! Why is this? How do I fix it? 回答1: As of bokeh 0.12.3, you can

How to use bokeh slider to update plot range?

时光毁灭记忆、已成空白 提交于 2020-02-25 10:19:07
问题 I am making a Bokeh dashboard in Python 3, and one of my main plots in-progress is a scatterplot. I have the entire plot made, but I am looking for a way to have two sliders (x and y) to specify the range displayed based on where they are slid to. p6 = figure(title = 'Average Duration and Number of Calls by Topic in Top Departments', y_range=(0,13000), tools=["hover", 'box_zoom', 'reset', 'save'], tooltips="@Topic; @Seconds seconds of average duration; @Count total calls") My not working