bokeh

Easiest way to plot data on country map with python

匆匆过客 提交于 2020-01-22 10:08:52
问题 Could not delete question. Please refer to question: Shade states of a country according to dictionary values with Basemap I want to plot data (number of sick people for a certain year) on each state of Mexico. I am using jupyter notebook. So far I have seen several options and tutorials, but none seem to seem to explicitly explain how to plot the map of a country. Below I explain some options/tutorial I have seen and why they have not worked (this I do just to argue that tutorials are not

Easiest way to plot data on country map with python

て烟熏妆下的殇ゞ 提交于 2020-01-22 10:08:29
问题 Could not delete question. Please refer to question: Shade states of a country according to dictionary values with Basemap I want to plot data (number of sick people for a certain year) on each state of Mexico. I am using jupyter notebook. So far I have seen several options and tutorials, but none seem to seem to explicitly explain how to plot the map of a country. Below I explain some options/tutorial I have seen and why they have not worked (this I do just to argue that tutorials are not

Bokeh Server callback from tools

南笙酒味 提交于 2020-01-21 03:23:08
问题 I'm kinda new on Python, and currently working on a interactive plot visualization using Bokeh where I need to show multiple related charts. To accomplish this i'm using bokeh server. I've been reading the docs and some examples but i've been unable to find an example of a python callback (executed in the server) triggered by a selection on the plot. Basically what i would like to do is something like: from bokeh.plotting import figure, curdoc from bokeh.layouts import column from bokeh

Bokeh Server callback from tools

故事扮演 提交于 2020-01-21 03:22:08
问题 I'm kinda new on Python, and currently working on a interactive plot visualization using Bokeh where I need to show multiple related charts. To accomplish this i'm using bokeh server. I've been reading the docs and some examples but i've been unable to find an example of a python callback (executed in the server) triggered by a selection on the plot. Basically what i would like to do is something like: from bokeh.plotting import figure, curdoc from bokeh.layouts import column from bokeh

How to create a Bokeh Tap tool to select all points of the ColumnDataSource sharing the same value in a given column

最后都变了- 提交于 2020-01-17 07:48:04
问题 I have a bunch of data plotted in a scatter plot using a ColumnDataSource and one column is the X coordinates another the Y coordinates. There's a third column with a patient ID that may have duplicates. I'd like to create a Tap derived tool that would select all other x,y coordinates that share the same value in the patient ID column. 'x' 'y' 'ID' 1 2 'p1' 2 3 'p1' 2 5 'p2' 0 1 'p2' So basically if I click in my bokeh scatter plot the coordinate (1,2) I'd get points at (1,2) and (2,3)

Pandas: Visualizing Changes in Event Dates for Multiple Years using Bokeh or any other plotting library

£可爱£侵袭症+ 提交于 2020-01-17 07:22:11
问题 I want to create a plot where the y-axis is the number of seasonal years I have data for and the x-axis is in months and days. Each seasonal year will have two dates. |1957|... |1956| d1--------d2 |1955| d1---------d2 |1954| d1---------d2 |June01|...|Jan01...|Feb11|...|Feb23|...|Feb26|...|Mar20|...|Mar25|.. I almost have the graph I want, except the x-axis covers the entire time span rather than just 12-months. from bokeh.plotting import figure p1 = figure(plot_width=1000, plot_height=300, x

Bokeh - check checkboxes with a button/checkbox callback

泪湿孤枕 提交于 2020-01-17 02:50:10
问题 How can I check checkboxes in a CheckBoxGroup by clicking a button or checking a separate checkbox in bokeh? I am aware of this solution in javascript jquery check uncheck all checkboxes with a button however the checkboxgroup bokeh object passed in customJS can't be manipulated with .prop ! Also I don't know of a way to access the individuals checkboxes inside the checkboxgroup. I am not sure how to do that with the bokeh checkboxgroup object. here is what I tried, plots is a list containing

layout for multiple Data Table as children in each Bokeh Tab

橙三吉。 提交于 2020-01-16 08:06:07
问题 I want to have several tables inside each Bokeh Tab (Bokeh Panel) However, the tables get attached together horizontally and I don't find a way to nicely show them. I used a dumb Div as a quick solution but it created too much space, even a Div with width=1. How shall I achieve this? Here is my code: from bokeh.models.widgets import Panel, Tabs, TableColumn,DataTable, Div import numpy as np from bokeh.io import output_notebook, show from bokeh.models import ColumnDataSource from bokeh.layouts

Bokeh: How to click and drag to display displacement between points

自作多情 提交于 2020-01-16 05:22:05
问题 I want to be able to click and drag between two points on my graph and display the change in position between points and display a line connecting the two points. How can I go about approaching this? 回答1: You can realize it with JS callback like this (Bokeh v1.3.0): import numpy as np from bokeh.plotting import figure, show from bokeh.models import ColumnDataSource, CustomJS, Div, Row from bokeh.events import * source = ColumnDataSource({'x': [], 'y': []}) p = figure(plot_width = 900) lines =

Pass variables from bokeh to JS via CustomJS

蓝咒 提交于 2020-01-14 05:14:49
问题 In the bokeh example http://docs.bokeh.org/en/latest/docs/user_guide/interaction/callbacks.html#customjs-for-hover the dictonary " links " is passed to the JS by adding it at the end of the code block with: .... """ % links Is it possible to pass over two variables and what would the syntax look like? I tried different versions like """ % links,myvar """ % ('links','myvar') """ % links, % myvar but they all create errors or do not work. I also found this Bokeh: pass vars to CustomJS for