bokeh

bokeh serve running but can't access with browser

ε祈祈猫儿з 提交于 2019-11-28 01:51:25
问题 I have installed bokeh and downloaded myapp.py from the official page (http://docs.bokeh.org/en/latest/docs/user_guide/server.html) which looks like this. # myapp.py from random import random from bokeh.layouts import column from bokeh.models import Button from bokeh.palettes import RdYlBu3 from bokeh.plotting import figure, curdoc # create a plot and style its properties p = figure(x_range=(0, 100), y_range=(0, 100), toolbar_location=None) p.border_fill_color = 'black' p.background_fill

Bokeh hover tooltip not displaying all data - Ipython notebook

两盒软妹~` 提交于 2019-11-28 01:21:56
问题 I am experimenting with Bokeh and mixing pieces of code. I created the graph below from a Pandas DataFrame, which displays the graph correctly with all the tool elements I want. However, the tooltip is partially displaying the data. Here is the graph: Here is my code: from bokeh.plotting import figure, show from bokeh.io import output_notebook from bokeh.models import HoverTool from collections import OrderedDict x = yearly_DF.index y0 = yearly_DF.weight.values y1 = yearly_DF.muscle_weight

Displaying only one tooltip when using the HoverTool() tool

余生长醉 提交于 2019-11-27 23:19:36
I am plotting very many points in Bokeh, and I have added the HoverTool to the list of tools of the figure, so that the mouse shows the x,y coordinates of the mouse when close to a glyph. When the mouse gets close to a set of glyphs closely packed together, I get as many tooltips as glyphs. I want instead only one tooltip, the one of the closest glyph. This isn't just a presentation detail, because for very many points this results: in slow interaction with the plot, with the browser getting stuck while all tooltips are generated in a very long tooltip, where the same information is repeated

How to add data labels to a bar chart in Bokeh?

守給你的承諾、 提交于 2019-11-27 22:25:54
问题 In the Bokeh guide there are examples of various bar charts that can be created. http://docs.bokeh.org/en/0.10.0/docs/user_guide/charts.html#id4 This code will create one: from bokeh.charts import Bar, output_file, show from bokeh.sampledata.autompg import autompg as df p = Bar(df, 'cyl', values='mpg', title="Total MPG by CYL") output_file("bar.html") show(p) My question is if it's possible to add data labels to each individual bar of the chart? I searched online but could not find a clear

Bokeh Plotting: Enable tooltips for only some glyphs

耗尽温柔 提交于 2019-11-27 20:42:45
问题 I have a figure with some glyphs, but only want tooltips to display for certain glyphs. Is there currently a way to accomplish this in Bokeh? Alternatively, is there a way to plot two figures on top of each other? It seems like that would let me accomplish what I want to do. 回答1: Thanks to this page in Google Groups I figured out how this can be done. Link here Edit 2015-10-20 : looks like the google group link doesn't work anymore unfortunately. It was a message from Sarah Bird @bokehplot.

Serving interactive bokeh figure on heroku

半城伤御伤魂 提交于 2019-11-27 20:18:08
I'm trying to serve an interactive bokeh figure via heroku. The figure I'm trying to have served is essentially equivalent to this one ( example , code ). I'm new to both bokeh and heroku so I'm pretty sure I'm missing something pretty basic -- I think what I'm trying to do should be quite straightforward. First, I can serve my figure locally using the bokeh serve --show myapp command. Where myapp is the name of the python module that includes the bokeh figure. Note that the --show flag just prompts bokeh to open a browser window once the figure is built and the server is running. Next, I've

Streaming two line graphs using bokeh

梦想与她 提交于 2019-11-27 16:48:14
问题 I would like to create a visualization where there are two line graphs which are updated with one new point per line graph per second. The result will be something like this. I have recently read about bokeh and found out that it can be used in visualizing streams of data in real time. However don't know how to code in it yet. I would appreciate it if someone can show me how this task can be done using bokeh. thanks! 回答1: For bokeh-0.11.1 : Basically, you need to run you python app in the

Data tooltips in Bokeh don't show data, showing '???' instead

天大地大妈咪最大 提交于 2019-11-27 14:31:43
I'm trying to create a stacked bar chart using Bokeh. I'd like to use the hover feature, displaying the relevant data in each part of the bar, but instead of the data Bokeh shows '???'. I got the data in an excel file called "Example worksheet", in a sheet called "Sales". The sheet looks like this: Year Category Sales 2016 A 1 2016 B 1 2016 C 1.5 2017 A 2 2017 B 3 2017 C 1 2018 A 2.5 2018 B 3 2018 C 2 I tried running the following code: import numpy as np import scipy as sp from bokeh.charts import Bar, output_file, show from bokeh.models import HoverTool import pandas as pd x = pd.read_excel(

Position the legend outside the plot area with Bokeh

牧云@^-^@ 提交于 2019-11-27 14:13:13
问题 I am making a plot following the example found here Unfortunately, I have 17 curves I need to display, and the legend overlaps them. I know I can create a legend object that can be displayed outside the plot area like here, but I have 17 curves so using a loop is much more convenient. Do you know how to combine both methods? 回答1: Ok, I found the solution. See the code below where I have just modified the interactive legend example: import pandas as pd from bokeh.palettes import Spectral4 from

In Bokeh, how do I add tooltips to a Timeseries chart (hover tool)?

妖精的绣舞 提交于 2019-11-27 12:02:36
问题 Is it possible to add Tooltips to a Timeseries chart? In the simplified code example below, I want to see a single column name ('a','b' or 'c') when the mouse hovers over the relevant line. Instead, a "???" is displayed and ALL three lines get a tool tip (rather than just the one im hovering over) Per the documentation ( http://docs.bokeh.org/en/latest/docs/user_guide/tools.html#hovertool), field names starting with “@” are interpreted as columns on the data source. How can I display the