# Performant, interactive Plots.jl backend for jupyter notebook

**URL:** <https://discourse.julialang.org/t/performant-interactive-plots-jl-backend-for-jupyter-notebook/11266>\
**Category:** Visualization\
**Tags:** jupyter, glvisualize\
**Created:** [May 30, 2018, 3:30pm UTC](https://discourse.julialang.org/t/performant-interactive-plots-jl-backend-for-jupyter-notebook/11266 "2018-05-30T15:30:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![standarddeviant](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/standarddeviant/32/2309_2.png) [@standarddeviant](https://discourse.julialang.org/u/standarddeviant)\
**Post date:** [May 30, 2018, 3:30pm UTC](https://discourse.julialang.org/t/performant-interactive-plots-jl-backend-for-jupyter-notebook/11266/1 "2018-05-30T15:30:47Z")

</div>

I’ve been using `Plots.jl` with `plotlyjs()` for interactive plots and automated ‘report’ generation. I appreciate the work that’s gone in to `Plots.jl` and `PlotlyJS.jl` - I use them every day!

Some of the individual plots have performance issues in the generated html files, so I play tricks like resampling my data (thanks to `DSP.jl`) and plot at lower sample rates, etc. But even at lower rates, with multiple plots, the generated pages and the interactive javascript can become rather slow.

For the curious, one of my data signals is typically 8M points, and for plotting I will usually resample to around 200k points. With spectrograms and multiple time series on multiple plots, that’s enough to slow things down on my relatively powerful desktop machine.

I know of `GLVisualize.jl` and know that it’s a work-in-progress backend for `Plots.jl`. Will `GLVisualize.jl` use WebGL, or something else, to render interactive plots in a more efficient way than relying on javascript to do all the heavy lifting?

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [May 30, 2018, 6:24pm UTC](https://discourse.julialang.org/t/performant-interactive-plots-jl-backend-for-jupyter-notebook/11266/2 "2018-05-30T18:24:02Z")

</div>

You should check out Makie - [Home](http://makie.juliaplots.org/stable/)  
It’s the future of GLVisualize, and I believe @sdanisch (the primary developer) intends for this to end up replacing Plots, providing the same functionality (backends, recipes, terse syntax) in pure julia.  
It’s particularly focused on interactivity but still in a relatively early stage of development (first release coming up soon).

---

<div class="post-metadata">

**Author:** ![MA\_Laforge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ma_laforge/32/385_2.png) [@MA\_Laforge](https://discourse.julialang.org/u/MA_Laforge)\
**Post date:** [June 5, 2018, 10:20pm UTC](https://discourse.julialang.org/t/performant-interactive-plots-jl-backend-for-jupyter-notebook/11266/3 "2018-06-05T22:20:27Z")

</div>

@standarddeviant: I had the exact same problem, and that’s why I developped InspectDR:

InspectDR: [GitHub - ma-laforge/InspectDR.jl: Fast, interactive Julia/GTK+ plots (+Smith charts +Gtk widget +Cairo-only images)](https://github.com/ma-laforge/InspectDR.jl)  
Gallery: [FileRepo/InspectDR/sampleplots/README.md at master · ma-laforge/FileRepo · GitHub](https://github.com/ma-laforge/FileRepo/blob/master/InspectDR/sampleplots/README.md)

- 200k points is only considered a _ **“moderate”** _ dataset for InspectDR. With 200k point, you still get very good interactivity with almost no lag when you drag plot data around in order to pan the plot & alter its limits.
  - You might want to bypass the Plots.jl module if you really need speed for _ **automated ‘report’ generation** _, though.

- Plot times are still good even when datasets are even larger (ex 2Gb datasets).
  - _ **Again:** _ You should bypass the Plots.jl (use InspectDR directly) if you want to minimize plot times.

### Conditions

- Performance is even good on a 7yr old computer running a VM session.
- InspectDR runs at optimum speeds when the x-axis data is sorted in increasing order.

### Caveat

- Does not support 3D plots.
- Performance is better if Plots.jl is bypassed (InspectDR used directly).
- Not directly interactive in Jupyter - but static plot images are supported (.png works best) & you can still launch the Gtk GUI to get the interactive mode.

I myself am looking forward to GLVisualize/Makie, but last time I checked, it is not yet able to do what I needed… But I am looking forward to the first release as well.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [June 6, 2018, 9:37am UTC](https://discourse.julialang.org/t/performant-interactive-plots-jl-backend-for-jupyter-notebook/11266/4 "2018-06-06T09:37:40Z")

</div>

Yes, should have pointed out inspectdr as well.

---

<div class="post-metadata">

**Author:** ![standarddeviant](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/standarddeviant/32/2309_2.png) [@standarddeviant](https://discourse.julialang.org/u/standarddeviant)\
**Post date:** [June 18, 2018, 1:53am UTC](https://discourse.julialang.org/t/performant-interactive-plots-jl-backend-for-jupyter-notebook/11266/5 "2018-06-18T01:53:37Z")

</div>

Thanks @mkborregaard - I will keep a watch on Makie.jl.

Thanks @MA_Laforge for writing InspectDR! I’ve used InspectDR as a Plots.jl backend, but will look at direct usage.

Is InspectDR doing something similar to to the Python package “datashader”?

---

<div class="post-metadata">

**Author:** ![MA\_Laforge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ma_laforge/32/385_2.png) [@MA\_Laforge](https://discourse.julialang.org/u/MA_Laforge)\
**Post date:** [June 19, 2018, 2:12am UTC](https://discourse.julialang.org/t/performant-interactive-plots-jl-backend-for-jupyter-notebook/11266/6 "2018-06-19T02:12:15Z")

</div>

@standarddeviant: Thanks for pointing me to `datashader` - I was unaware of this package.

To a certain extent: yes, `InspectDR` does something similar to `datashader` is doing:

1. It performs a reduction of the data for each zoom level, parsing the entire dataset each time.

### Differences:

1. Data reduction in `InspectDR` is much less flexible than `datashader` - especially with scatter plots.

2. It sounds like the `datashader` algorithm might even be faster than the one in `InspectDR` (time per # of points), but I have not verified this.

### NOTE

- There are probably other differences, but I don’t understand `datashader` well enough… and I have not had a chance to study the algorithm they use.
- I might eventually want to make use of `datashader` from within `InspectDR`… but I probably should see if there are licensing issues with this before I start (I am not quite certain what its license entails).

---

<div class="post-metadata">

**Author:** ![James\_Bednar](https://avatars.discourse-cdn.com/v4/letter/j/b5ac83/32.png) [@James\_Bednar](https://discourse.julialang.org/u/James_Bednar)\
**Post date:** [August 29, 2018, 9:46pm UTC](https://discourse.julialang.org/t/performant-interactive-plots-jl-backend-for-jupyter-notebook/11266/7 "2018-08-29T21:46:05Z")

</div>

[Datashader’s license](https://github.com/bokeh/datashader/blob/master/LICENSE.txt) is just [BSD 3-clause](https://opensource.org/licenses/BSD-3-Clause), which is highly permissive and unlikely to prevent any reasonable use you would have of it. Go for it!

---

<div class="post-metadata">

**Author:** ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)\
**Post date:** [August 30, 2018, 3:29am UTC](https://discourse.julialang.org/t/performant-interactive-plots-jl-backend-for-jupyter-notebook/11266/8 "2018-08-30T03:29:59Z")

</div>

VegaLite.jl is another plotting library, but is not compatible with `Plots.jl`. I am not sure if this will work for you. It provides a “grammer of graphics”.
