Created
November 3, 2016 16:08
-
-
Save burbma/1e902094665446d483c895a3182f67e8 to your computer and use it in GitHub Desktop.
Bokeh default selected dot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| from bokeh.plotting import figure | |
| from bokeh.models import ColumnDataSource | |
| from bokeh.io import output_notebook, show | |
| # prepare some date | |
| N = 300 | |
| x = np.linspace(0, 4*np.pi, N) | |
| y0 = np.sin(x) | |
| # NEW: create a column data source for the plots to share | |
| source = ColumnDataSource(data=dict(x=x, y0=y0), | |
| selected={'0d': {'glyph': None, 'indices': []}, | |
| '1d': {'indices': [N/2]}, | |
| '2d': {}}) | |
| TOOLS = "tap" | |
| # create a new plot and add a renderer | |
| p = figure(tools=TOOLS, width=350, height=350, title=None) | |
| c = p.circle('x', 'y0', source=source) | |
| # show the results | |
| show(p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment