Arviz: Bokeh backend

Created on 18 May 2018  路  9Comments  路  Source: arviz-devs/arviz

What about adding bokeh backend for plots?

Most helpful comment

I know this proposal is low priority, but it might also be useful to consider plotly as a plotting backend. In particular, their dash framework is pretty cute for building interactive apps...

All 9 comments

Hi,

My guess is that either Bokeh (or also Altair) needs to have a function to automatically translate matplotlib object to Bokeh (Altair) object, or we split functions for plotting and plot_data.

If we are doing the split, we should normalize the input - output types (some semi-official doc would be great).

Adding Altair could be a great option, specially considering this project

@aloctavodia @ColCarroll

Would it be doable to separate plot functions and data functions?

I have a rough example here: https://github.com/stan-dev/pystan/tree/feature/update_plotting/pystan/plot (It is from a recent PR before we decided to use Arviz).
One would call plotting functions as normal but inside the function, the raw data is transformed to predefined format (dictionary) and then the plot is done from it. Something very similar to Vega (or is it Vegalite). One could save the "data" and then later input it the plotting function if needed.

This way we can also use other backends. Just define a function that can make a plot from the predefined format.

The holy grail would somehow use a metalanguage for each plot and then just define functions for each backend (plot_histogram = plt.histogram) and give those functions as a dictionary.

P.s. If you want to do it in the conventional format (duplicate the code for each backend) I have no problem with this approach.

@ahartikainen I think this is very similar to the altair library I have been playing with. I think the traceplot I am building almost works just like that, where you do not need to import the data to specify it. See for example this plot, where the actual data is only added on the very last line. Interestingly, the dataset could be a pandas dataframe, or it could be a URL that returns JSON.

I think that will be harder with matplotlib, but I have not thought carefully about this.

Not sure if this is just wishful thinking but if the matplotlib renderer becomes a reality, then having altair and matplotlib should be almost trivial.

I know this proposal is low priority, but it might also be useful to consider plotly as a plotting backend. In particular, their dash framework is pretty cute for building interactive apps...

I not-very-secretly think the converters and netCDF format are the most interesting part of the project - there is a concerted effort to get this to take over pymc3's plotting/diagnostics before doing any other major features.

I'd love to have interactive plotting for all this, and that's on my list of things to try out (along with matplotlib widges and altair)! I'm also very happy to help out if someone else picks that up.

Drive-by comment, so apologies if this has been mentioned elsewhere, but can I interject with Holoviews?

Serves as a high-level interface supporting rendering via MPL / Bokeh, I've been getting to grips with it myself recently. Still has a few rough edges but you might like to at least check it out before attempting to build a whole render-agnostic layer.

Interesting project, good luck!

Should this be closed?

Was this page helpful?
0 / 5 - 0 ratings