bokeh

How do I integrate a Bokeh Server into a Pyramids Application?

倾然丶 夕夏残阳落幕 提交于 2019-12-03 21:29:48
In order of complexity, with Pyramids, I can create static bokeh graphs and then incorperate them with div tags like outlined here . The Bokeh documentations explain clearly how one can setup a bokeh server for interactive data exploration, and I have successfully created such an application. What I would like to do though is to have an interactive graph within a Pyramids view page. The requirements of this page would be as followed: Upon loading of the view, a bokeh server is somehow started, and the data is loaded into the server's object model. Somehow the Pyramid view will also receive the

Using colormap with bokeh scatter

≯℡__Kan透↙ 提交于 2019-12-03 17:38:58
问题 In matplotlib the scatterplot offers the possibility of using the color of a plot to indicate value or magnitude like this plot: For bokeh , similar examples seem to manually generate the rgb colors, which makes it difficult to produce plots with color scaled by magnitude, esp. wrt. diverging colormaps. Is it possible to have similar functionality in bokeh , or to use matplotlib colormaps to set the color? 回答1: It's easy enough to just use matplotlib 's colormaps directly. For example, the

How to configure Nginx with gunicorn and bokeh serve

放肆的年华 提交于 2019-12-03 17:29:20
I want to serve a flask app that uses embedded bokeh serve from a server on my local network. To illustrate I made an example using the bokeh serve example and a docker image to replicate the server. The docker image runs Nginx and Gunicorn. I think there is a problem with my nginx configuration routing the requests to the /bkapp uri. I have detailed the problem and provided all source code in the following git repo I have started a discussion on bokeh google group Single Container In order to reduce the complexity of running nginx in its own container I built this image that runs nginx in

Limit bokeh plot pan to defined range

主宰稳场 提交于 2019-12-03 16:57:11
I was wondering if it were possible to limit the range of the "pan" tool for bokeh generated plots? For example, say I had this simple plot: from bokeh.plotting import output_file, rect, show output_file('test.html') rect([10,20,30], [10,20,30], width=[1,2,3], color=['red','blue','green'], height=5, plot_width=400, plot_height=400, tools = "ypan,box_zoom,reset") show() The ypan tool works great, but I could keep panning until my graph disappears. Is there any way I can constrain the pan? The pan/zoom limit feature has been added after this question was first posed. You can feed the y_range or

Using bokeh: How does one plot variable size nodes, and node colors?

一个人想着一个人 提交于 2019-12-03 16:41:07
I am trying to display a graph using networkx with bokeh 12.7 that Has node size based on node degrees Color based on another node attribute. Desired Output: Data Setup import pandas as pd import numpy as np import networkx as nx import seaborn as sns from bokeh.io import show, output_notebook #output_file, from bokeh.plotting import figure from bokeh.models.graphs import from_networkx from bokeh.models import GraphRenderer, StaticLayoutProvider, LinearColorMapper, ColumnDataSource from bokeh.palettes import Spectral8, Spectral4 G = nx.karate_club_graph() # Some Random index node_color = {k:v

Infinite horizontal line in Bokeh

爱⌒轻易说出口 提交于 2019-12-03 15:14:10
问题 Is there a way to plot an infinite horizontal line with Bokeh? The endpoints of the line should never become visible, no matter how far out the user is zooming. This is what I've tried so far. It just prints an empty canvas: import bokeh.plotting as bk import numpy as np p = bk.figure() p.line([-np.inf,np.inf], [0,0], legend="y(x) = 0") bk.show(p) One way would be to set the endpoints extremely high/low and the figure's x_range and y_range very small in relation to them. import bokeh.plotting

How do you add more x axis ticks and labels to datetime axis using Python's Bokeh?

倾然丶 夕夏残阳落幕 提交于 2019-12-03 12:05:16
I've been testing out Python's Bokeh, specifically the candlestick chart tools but have been unable to figure out how to add more than 5 datetime labels/ticks to my chart. Any insight would be appreciated. Here's the code: from math import pi import pandas as pd import pandas.io.data as web from bokeh.plotting import * stocks = 'FB' ####################################################### date_today = time.strftime("%x") def get_px(stock, start, end): return web.get_data_yahoo(stock, start, end) x = get_px(stocks, '1/1/2013', date_today) ###################################################### ##

Adding node labels to bokeh network plots

旧街凉风 提交于 2019-12-03 11:36:27
I am using the following code to produce an interactive bokeh network graph. How do I add the name of the nodes to the nodes in the bokeh plot? from bokeh.io import show, output_notebook from bokeh.models import Plot, Range1d, MultiLine, Circle, HoverTool, TapTool, BoxSelectTool from bokeh.models.graphs import from_networkx, NodesAndLinkedEdges, EdgesAndLinkedNodes from bokeh.palettes import Spectral4 from bokeh.models import LabelSet plot = Plot(plot_width=900, plot_height=500, x_range=Range1d(-1.1,1.1), y_range=Range1d(-1.1,1.1)) plot.title.text = "Graph Interaction Demonstration" plot.add

Timeseries streaming in bokeh

走远了吗. 提交于 2019-12-03 09:48:43
问题 I want to plot a live time series in bokeh. I want to plot only the new data points at each update. How can I do this ? There is an example on the bokeh website for animated plots but it involves redrawing the whole picture every time. Also I am looking for a simple example where I can do a live plot of a time series point by point. 回答1: As of Bokeh 0.11.1 there is now a streaming interface to column data sources in Bokeh server apps. You can see and easily run an example here: https://github

Hide Axis in Bokeh

柔情痞子 提交于 2019-12-03 09:38:11
How can I hide both x and y axis in a bokeh plot ? I've checked and tried based on this : p1= figure (... visible=None) p1.select({"type": "Axis", "visible": 0}) xaxis = Axis(plot=p1, visible = 0) and like http://docs.bokeh.org/en/latest/docs/user_guide/styling.html#axes Hemanth Kondapalli Create a figure object. So, in your example the figure object is p1 , then p1.axis.visible = False If you want to specify a y or x axis, then use p1.xaxis.visible = False or p1.yaxis.visible = False Set the axes parameters in the figure object: p1 <- figure(xaxes = FALSE, yaxes = FALSE) or if you also want