Publication quality plots from Bokeh

I was told at the Scipy tutorial session to bring this up on the list, so here it is :wink:

I’m wondering whether a goal of achieving publication-quality plots is on the roadmap for Bokeh. I heard in Bryan’s (excellent) talk at Scipy today that static image saving is high on the priority list, so that’s great to hear. I also recognize this is quite a challenge of this as discussed in https://groups.google.com/a/continuum.io/forum/#!msg/bokeh/9lRQsnr-Dok/hM. That’s obviously a key step, so that might answer the question, but it’s not entirely clear to me if this is sort of a nice side feature as opposed to a design goal (even if it involves partly leveraging matplotlib).

Let me take a moment to clarify why I’m asking (note that here I’m intentionally wearing my scientist hat as opposed to thinking like a developer): I really *want *to be able to use Bokeh in my day-to-day work. But it’s difficult to justify the time to learn it or even use it in quick analysis if I can’t eventually make plots that I can include in publications. These are the bread-and-butter of science (at least right now), so I need some way to take an interactive visualization and flatten it into a static plot in a form that can be embedded into a LaTeX paper and still look decent. IMHO, this is one of the best ways to actually push the world forward into ubiquitously enabling these kind of interactive visualizations in their full glory. Once scientists who are currently used to thinking about static plots see that they can get both for the price of one, they will start demanding the interactivity from publishers. I could see Bokeh being a key technology for that in my field, but only if it can fill this dual role.

We’ve worked a little bit on this on the R side. It’s an experimental feature and a bit hacky in that you need to have phantomjs installed on your machine. It makes a png file, which if done at high enough resolution is good for publication. At the moment it does not control resolution but I think that could be added pretty easily.

Don’t know if showing it is helpful for thinking of a universal approach, but here’s an example.

The code below assumes you have phantomjs installed on your system. In R:

install experimental branch from here

devtools::install_github(“hafen/[email protected]”)

library(rbokeh)

figure(tools = NULL) %>%

ly_points(1:10) %>%

save_figure("/tmp/test.png")

···

On Jul 9, 2015, at 1:05 AM, [email protected] wrote:

I was told at the Scipy tutorial session to bring this up on the list, so here it is :wink:

I’m wondering whether a goal of achieving publication-quality plots is on the roadmap for Bokeh. I heard in Bryan’s (excellent) talk at Scipy today that static image saving is high on the priority list, so that’s great to hear. I also recognize this is quite a challenge of this as discussed in https://groups.google.com/a/continuum.io/forum/#!msg/bokeh/9lRQsnr-Dok/hM. That’s obviously a key step, so that might answer the question, but it’s not entirely clear to me if this is sort of a nice side feature as opposed to a design goal (even if it involves partly leveraging matplotlib).

Let me take a moment to clarify why I’m asking (note that here I’m intentionally wearing my scientist hat as opposed to thinking like a developer): I really *want *to be able to use Bokeh in my day-to-day work. But it’s difficult to justify the time to learn it or even use it in quick analysis if I can’t eventually make plots that I can include in publications. These are the bread-and-butter of science (at least right now), so I need some way to take an interactive visualization and flatten it into a static plot in a form that can be embedded into a LaTeX paper and still look decent. IMHO, this is one of the best ways to actually push the world forward into ubiquitously enabling these kind of interactive visualizations in their full glory. Once scientists who are currently used to thinking about static plots see that they can get both for the price of one, they will start demanding the interactivity from publishers. I could see Bokeh being a key technology for that in my field, but only if it can fill this dual role.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/5fa6c1ef-508a-4331-be2b-578bb4731626%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Erik,

Thanks for the question. I would first say that high quality static output has always been a big priority, but would immediately add that for most of the last 18 months there have been basically nothing but big priorities. :slight_smile: Additionally, this issue, and the issue of LaTeX annotations had implications for each other, so there was sort of a mutual blockage of effective decision making about either of them. That said, here is what I can say for certain today:

LaTeX/Math text

···

---------------

Someone is going to start looking into using KaTeX for math text annotation in the next week or so. Hopefully the experimental KaTeX canvas renderer will work great for us. If not, we will look at absolutely positioning divs above the plot. Either way, we are uncoupling this decision from the static output question, and proceeding with what seems tone the best technical option.

Static Rendering
----------------

Rumblings here at SciPy are about reviving the MEP 25 effort (MPL serialization) so we will participate / help / pursue this option as far as we can. I think it would be the best for a number of reasons. However, since there is no timeline at all for this, and it involves multi-project/person coordination, so I am probably going to personally try to investigate some other avenues in parallel. I have fairly extensive previous experience with Cairo, and the API is quite similar to HTML canvas, so I intend to make a stab at porting just enough BokehJS rendering machinery to cover static plots (no tools handing, e.g). Definitely less ideal I think, but also seems concretely realizable in the short term.

Hope this information is useful, certainly anyone who has suggestion or the ability or experience to help out is encouraged to chime in. There's lots to do and new help is very welcome :slight_smile:

Bryan

On Jul 9, 2015, at 12:05 AM, [email protected] wrote:

I was told at the Scipy tutorial session to bring this up on the list, so here it is :wink:

I'm wondering whether a goal of achieving publication-quality plots is on the roadmap for Bokeh. I heard in Bryan's (excellent) talk at Scipy today that static image saving is high on the priority list, so that's great to hear. I also recognize this is quite a challenge of this as discussed in https://groups.google.com/a/continuum.io/forum/#!msg/bokeh/9lRQsnr-Dok/hM. That's obviously a key step, so that might answer the question, but it's not entirely clear to me if this is sort of a nice side feature as opposed to a design goal (even if it involves partly leveraging matplotlib).

Let me take a moment to clarify why I'm asking (note that here I'm intentionally wearing my scientist hat as opposed to thinking like a developer): I really want to be able to use Bokeh in my day-to-day work. But it's difficult to justify the time to learn it or even use it in quick analysis if I can't eventually make plots that I can include in publications. These are the bread-and-butter of science (at least right now), so I need some way to take an interactive visualization and flatten it into a static plot in a form that can be embedded into a LaTeX paper and still look decent. IMHO, this is one of the best ways to actually push the world forward into ubiquitously enabling these kind of interactive visualizations in their full glory. Once scientists who are currently used to thinking about static plots see that they can get both for the price of one, they will start demanding the interactivity from publishers. I could see Bokeh being a key technology for that in my field, but only if it can fill this dual role.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/5fa6c1ef-508a-4331-be2b-578bb4731626%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.