bokeh

Bokeh Serve HTTPS instead of HTTP

时光毁灭记忆、已成空白 提交于 2019-12-11 06:07:53
问题 How to use HTTPS instead of HTTP for Bokeh Serve ? The command I use is: bokeh serve --port 8000 I'm using an Amazon EC2 with a docker container (exposed and forwarded port 8000, everything works with HTTP). With a Jupyter notebok you can for example use a certfile to allow HTTPS traffic: --certfile=/.keys/mycert.pem 回答1: EDIT: The old answer is obsolete. As of Bokeh 1.4, you can terminate SSL directly on the Bokeh server (no Nginx required): https://docs.bokeh.org/en/latest/docs/user_guide

How to use a CDS column to set the “line_dash” of a Multiline glyph?

♀尐吖头ヾ 提交于 2019-12-11 06:02:49
问题 I am plotting Multilines with the method multi_line . from bokeh.plotting import figure, show from bokeh.models import ColumnDataSource source = ColumnDataSource(data=dict( x=[3, 3], y=[4, 4], xs1=[[1, 2, 3], [2, 3, 4]], ys1=[[6, 7, 2], [4, 5, 7]], xs2=[[8, 9], [10, 11, 12]], ys2=[[6, 7], [7, 8, 9]], color=['red', 'green'], width=[5, 1], dash=['solid', 'dashed'] ) ) p = figure( plot_width=400, plot_height=400, tools='lasso_select,pan,wheel_zoom' ) p.multi_line( xs='xs1', ys='ys1', source

Bokeh get values from CustomJS (change values in data source)

泄露秘密 提交于 2019-12-11 05:56:44
问题 I have modified this example. What I want- eventually- is a way to get the datapoints selected in a graph and modifiy them in the python code. Thus I added a function here that should return the values from the second graph (thats what the button is for). However, if I select the points, they are plotted correctly, but the data source is not changed (the button click provides {'X':[],'Y':[]}. How do I write back from JS to the python bokeh data source? Isn't the s2.change.emit() or a s2

Access data from bokeh widgets in a jupyter notebook

不羁的心 提交于 2019-12-11 04:15:32
问题 I want to use a text input widget in a jupyter notebook with autocompletion. I therefore used AutocompleteInput() from bokeh.models.widgets.inputs . from bokeh.models.widgets.inputs import AutocompleteInput from bokeh.io import output_notebook from bokeh.plotting import show output_notebook() txt_input = AutocompleteInput(completions=['val1', 'val2']) show(txt_input) Displaying the widget and autocompletion works fine, but how can I access the value of the input widget upon change? txt_input

Cannot plot Histogram on Ubuntu 14.04

纵饮孤独 提交于 2019-12-11 03:53:24
问题 I'm using Python 2.7 and Bokeh 0.12.4 on Ubuntu 14.04. I have a data frame like so: msrp price compact 1.0 1.0 sedan 2.0 3.0 suv 3.0 5.0 sport 4.0 7.0 made this way: import pandas as pd from bokeh.charts import Histogram, output_file, show s = pd.Series([1,2,3,4], index=['compact', 'sedan', 'suv', 'sport'], dtype='float64') s2 = pd.Series([1,3,5,7], index=['compact', 'sedan', 'suv', 'sport'], dtype='float64') df = pd.DataFrame({'msrp': s, 'price': s2}) output_file('test.html') p = Histogram

Python Bokeh HoverTool formatters error: “unexpected attribute 'formatters' to HoverTool”

有些话、适合烂在心里 提交于 2019-12-11 02:59:47
问题 I used jupyter notebook to do a practice of visualization, then I followed the code on http://docs.bokeh.org/en/latest/docs/user_guide/tools.html#basic-tooltips the code on the website It works, so I tried to add the "Formatting Tooltip", like the below code. I just only added the attribute 'formatters', but the error happened. from bokeh.plotting import figure, ColumnDataSource from bokeh.models import HoverTool from bokeh.io import output_notebook, show output_notebook() source =

Bokeh, combination of bar and line chart

徘徊边缘 提交于 2019-12-11 02:57:24
问题 I am trying to plot a line on top of a bar chart within bokeh. I have tried: p1 = figure()... p1.renderer.append(Bar(...)) p1.renderer.append(Line(...)) show(p1) So far I had no luck. 回答1: Combination of two or more graphs in one plot in Bokeh is possible using the Basic Glyphs. For your question we can use line and rect. from bokeh.plotting import figure, output_file, show from bokeh.models.ranges import Range1d import numpy output_file("line_bar.html") p = figure(plot_width=400, plot_height

Using Holoviews, how can I set a title?

时光毁灭记忆、已成空白 提交于 2019-12-11 02:47:55
问题 I have been trying to set a title when using Holoviews and Bokeh. I'm overlaying 3 plots on each other. The code looks like this: %%opts Curve [width=900 height=400 show_grid=True tools=['hover'] finalize_hooks=[apply_formatter]] %%opts Curve (color=Cycle('Category20')) %%opts Overlay [ legend_position='bottom' ] Curve (muted_alpha=0.5 muted_color='black' ) actual_curve = hv.Curve(df_reg_test, 'date', 'y', label='Actual') existing_curve = hv.Curve(df_reg_test, 'date', 'Forecast Calls', label=

Holoviews color per category

被刻印的时光 ゝ 提交于 2019-12-11 02:37:27
问题 I have been lately working with bokeh for plotting. I just found out about holoviews and wanted to plot a basic box plot. In my box plot I am trying to color per one of the categories I am grouping the data in. Here is the code I am using: hv.extension('bokeh') %opts BoxWhisker (box_color='blue') boxwhisker = hv.BoxWhisker(pool_ride_distance_time_year_less_hour, ['total_time', 'customer'], 'amount') plot_opts = dict(show_legend=False, width=800, height=400) I am trying to color it differently

How do I pre-select rows in a Bokeh.widget.DataTable?

大城市里の小女人 提交于 2019-12-11 02:31:45
问题 Bokeh has the ability to display data in a dataframe as shown here: http://docs.bokeh.org/en/latest/docs/user_guide/interaction/widgets.html#data-table The Setup: I have a dataframe of the following format: Index|Location|Value -----|--------|----- 1 |1 | 10 2 |1 | 20 3 |1 | 30 4 |2 | 20 5 |2 | 30 6 |2 | 40 This dataframe can be displayed in a data table like so: source = ColumnDataSource(data={ LOCATION_NAME: [], VALUE_NAME: [] }) columns = [ TableColumn(field=LOCATION_NAME, title=LOCATION