BoxPlot and other questions

Bryan, all,

A few questions if I may.

  1. BoxPlot. If I were to use bokeh.charts.Boxplot, how can I plot other glyphs, e.g. circles, segments on top of it?

  2. Does BoxPlot support a ColumnDataSource?

  3. I need to be able to show a subset of BoxPlot categories depending on the state of a widget. What’s the best way of achieving this without redrawing the plot from scratch? Ideally would manipulate the source. Am I better off plotting the elements of the BoxPlot myself, akin boxplot.py — Bokeh 2.4.2 Documentation?

  4. interact_basic.ipynb has disappeared from 0.11.0. What’s the standard of interacting with bokeh and ipywidgets widgets from a jupyter notebook?

Many thanks.

Bryan, all,

A few questions if I may.

Always!

1. BoxPlot. If I were to use bokeh.charts.Boxplot, how can I plot other glyphs, e.g. circles, segments on top of it?

Right now this is possible, but somewhat difficult. There are plans to add all the bokeh.plotting.figure style "glyph methods" to charts but this work has not been done yet. Right now you'd have to use .add_glyph to add a low-level Glyph model directly, you can see an example here:

  https://github.com/bokeh/bokeh/blob/master/examples/models/glyph1.py

2. Does BoxPlot support a ColumnDataSource?

BoxPlot has to create several different column data sources, but it uses them internally. The data that gets sent to the browser is not your original data. The data you pass has statistical aggregations performed on it, and then data for geometric coordinates is put into the data sources for the various glyphs that make up a boxplot. So although technically the answer is "yes" I'm goign to venture that it might not be in the sense that you are asking.

3. I need to be able to show a subset of BoxPlot categories depending on the state of a widget. What's the best way of achieving this without redrawing the plot from scratch? Ideally would manipulate the source. Am I better off plotting the elements of the BoxPlot myself, akin http://bokeh.pydata.org/en/latest/docs/gallery/boxplot.html?

Because of what I mention above about bokeh.charts, (how the data in the browser is "one step removed" from the original data) there is currently no option but to recreate a new chart. You could "update in place" using the bokeh.plotting API, but in that case you would have to do more work to make the glyphs and data sources to render a boxplot "by hand".

4. interact_basic.ipynb has disappeared from 0.11.0. What's the standard of interacting with bokeh and ipywidgets widgets from a jupyter notebook?

The "push_notebook" function was actually dramatically improved, you can now update almost any aspect of a plot or any other Bokeh model, not only data sources. But the examples did move locations, the new notebooks are here:

  https://github.com/bokeh/bokeh/tree/master/examples/howto/notebook_comms

Thanks,

Bryan

···

On Apr 21, 2016, at 9:54 AM, [email protected] wrote: