bokeh

Bokeh plots do not display in QWebView

点点圈 提交于 2019-12-01 10:00:21
问题 I have following code that works on linux and my windows 7 machine even using WinPython environment: # plt_file is valid html produced by Bokeh and that is correctly displayed in browser with open(plt_file, "r") as f: plot = f.read() # self.plot_web_view.setContent(plot) url = QUrl(plt_file) self.plot_web_view.setHtml(plot, url) But when I distribute my application using WinPyhton my plot doesn't show up in QWebView and no error is raised... If I try to load random html-files into QWebView in

Bokeh DataTable won't update after trigger('change') without clicking on header

余生颓废 提交于 2019-12-01 08:36:14
Bokeh version: 0.10 Python: 3.4 Jupiter: 4.x Goal: create a table that only shows data selected from a scatter plot Problem: the DataTable only refreshes itself after being clicked on despite the: s2.trigger('change'). In other examples on Bokeh site one plot will update another using this technique: see http://bokeh.pydata.org/en/latest/docs/user_guide/interaction.html#customjs-for-selections the code below should run in a Jupyter notebook if you're using the above mentioned versions. and, thanks for any help. Joe from bokeh.io import output_notebook, show from bokeh.plotting import figure

How to plot Horizontal Bar Chart in Bokeh (Python)

…衆ロ難τιáo~ 提交于 2019-12-01 08:28:52
问题 I have this data: data = {'Cities': {'Des_Moines': 80.0, 'Lubbock': -300.0, 'Minneapolis': 85.7, 'Orange_County': 80.0, 'Salt_Lake_City': 81.8, 'San_Diego': 80.0, 'San_Francisco': -400.0, 'Troy': -400.0, 'Wilmington': -300.0}} I have plotted this using Seaborn and it looks great. df_data = pd.DataFrame(data).sort_values('Cities', ascending=False) sns.barplot(x='Cities', y=df_data.index, data=df_data, label='Cities', palette='Greens') However, I'll like to embed this is a Flask web app using

Bokeh server - How to manipulate a selection in a callback function

◇◆丶佛笑我妖孽 提交于 2019-12-01 08:28:44
I am plotting several patches that are grouped by a category "group" in the data source. What would I like to achieve is the following: By clicking on one patch, not only the patch itself but all patches of the same group should be highlighted as selected. I found that ColumnDataSource has an attribute selected . However, manipulating this attribute in the callback function does not have the desired effect. import os from bokeh.models import ColumnDataSource, Patches from bokeh.plotting import figure from bokeh.layouts import row from bokeh.io import output_file, curdoc import pandas as pd x =

How do I integrate Bokeh with Angular 4?

给你一囗甜甜゛ 提交于 2019-12-01 08:11:15
问题 I have bokeh plot being generated in the backend, which I want to embed onto an already existing angular 4 webapp. Currently I've use the bokeh.components function which yields the following two html tags. <script type="text/javascript"> (function() { var fn = function() { Bokeh.safely(function() { (function(root) { function embed_document(root) { var docs_json = '{"d199dc51-c663-4220-800f-a5f0d7c3a97a":{"roots":{"references":[{"attributes":{"bottom_units":"screen","fill_alpha":{"value":0.5},

Can I change tickers in a plot to custom text tickers?

对着背影说爱祢 提交于 2019-12-01 07:55:42
问题 I'm trying to change the x-axis on a plot to get ordinal text values and I'm having a hard time trying to find a workaround. Here is my goal: I want to show the IRR of 2 proposed modifications of a government program for the retirees who had middle incomes of 20 000$ and 50 000$ in their whole life. So, I have 4 IRR: 2 for the ones with 20 000$, and 2 for the ones with 50 000$. What's tricky is that I don't have exact x-coordinates; instead, I used nominal x-coordinates to build my histogram

Bokeh patches plot with dates as x-axis shifts the ticks one to the right

别等时光非礼了梦想. 提交于 2019-12-01 06:49:11
I'm trying to adapt the brewer example ( http://bokeh.pydata.org/en/latest/docs/gallery/brewer.html ) to my needs. One of the things I'd like is to have dates at the x-axis. I did the following: timesteps = [str(x.date()) for x in pd.date_range('1950-01-01', '1951-07-01', freq='MS')] p = figure(x_range=FactorRange(factors=timesteps), y_range=(0, 800)) p.xaxis.major_label_orientation = np.pi/4 as an adaptation of the previous line p = figure(x_range=(0, 19), y_range=(0, 800)) The dates are displayed, but the first date 1950-01-01 sits at x=1. How can I shift it to x=0? The first real data

How to reference selected bokeh data points

末鹿安然 提交于 2019-12-01 06:43:07
I have created a bokeh figure which uses circle glyphs and which has a lasso_select tool. This is run from within a ipython notebook. When I view the figure (which is representing a scatter chart), I select the circles which appear as outliers. If there a way to reference the selected data from the notebook ? I suspect that source.selected (where source is the ColumnDataSource used to build the chart) would contain the data I want, however this always is set to: {'0d': {'flag': False, 'indices': []}, '1d': {'indices': []}, '2d': {'indices': []}} Perhaps this is not possible ? Or perhaps I need

Adding python libraries to google datalab environment

耗尽温柔 提交于 2019-12-01 06:07:34
I'm using google datalab on google cloud platform. Worked great on the first try and I love how easy it is to now run a jupyter notebook server in the cloud (faster than starting up a localhost server). It's fantastic. But now I want to install python libraries not included in the basic datalab environment (specifically I need the Bokeh plotting library). So I opened a google cloud shell from the google cloud console where I manage this jupyter notebook instance, installed miniconda and then the bokeh library. Everything ran without error (e.g. bokeh installs several dependencies along the way

Bokeh tools not working in QWebView

一世执手 提交于 2019-12-01 05:58:15
Good afternoon [ First time to post on stackoverflow after years of reading. Exciting! ] I use bokeh to generate html code that I feed into a QWebView in a very simple PyQt4 GUI. The standard tools on top of the bokeh chart do not work in the QWebView, while they work properly if I open the same html code in any standard browser (in my case, Chrome). Detailed example: I am using the snippet below taken from an older Bokeh User Guide example to test the issue (the latest User Guide can be found here ): from bokeh.plotting import figure from bokeh.resources import CDN, INLINE from bokeh.embed