# Zoomable and pannable plots (in a separate window)? (Atom/MacOS)

**URL:** https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352
**Category:** General Usage
**Created:** [February 8, 2020, 5:29pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352 "2020-02-08T17:29:54Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Jandyman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandyman/32/12712_2.png) [@Jandyman](https://discourse.julialang.org/u/Jandyman)
#### Post date: [February 8, 2020, 5:29pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/1 "2020-02-08T17:29:54Z")

</div>

I’m new to Julia / Atom / Juno. I’m excited about the possibilities, being an ex LISPer. Although something is a bit slow (Atom, JIT compilation?), it’s a pretty good user experience. The Juno debugger seems very well designed.

But then there are the plots. What I’m looking for, and think a lot of people are looking for, is the “matlab plotting experience”. Plots you can edit, but specifically zoom and pan the _contents_ of the plot. I can do this with Matplotlib/Python/Spyder. It’s not exactly Matlab, but it is good enough.

I haven’t even been able to get a plot in Julia/Atom to appear in a separate pop-out window, much less get the contents to be zoomable and pannable. I’ve tried the gui() function and ENV[“PLOTS\_USE\_ATOM\_PLOTPANE”] = false, but neither seem to work. I’m on MacOS Catalina.

Is what I’m after even possible? This issue seems to always be a stumbling block when trying to find a Matlab replacement.

---

<div class="post-metadata">

### Author: ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)
#### Post date: [February 8, 2020, 5:48pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/2 "2020-02-08T17:48:08Z")

</div>

I don’t think it’s possible yet. However, since I started using Julia/Juno a few months ago, several things have improved & become more stable.  
I try to contribute however I can:  
Posting bugs, feature requests, & sometimes solutions.  
Consider posting a feature request here:

> **[Issues · JunoLab/Juno.jl](https://github.com/JunoLab/Juno.jl/issues)**
>
> Contribute to JunoLab/Juno.jl development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [February 8, 2020, 6:00pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/3 "2020-02-08T18:00:58Z")

</div>

Check out Makie.jl and my extension of it, MakieLayout.jl. [GitHub - jkrumbiegel/MakieLayout.jl: Layouting for Makie.jl](https://github.com/jkrumbiegel/MakieLayout.jl)

This will give you plots that you can zoom and pan and MakieLayout.jl is even nicer than Matlab (in my totally biased opinion) for building up a layout of plots iteratively. You can add as many subplots in complex sub layouts as you want and they should be aligned perfectly relative to each other. You can also easily add interaction like sliders and buttons with a convenient syntax.

The packages are relatively new and in flux, though, so their APIs are not settled yet and are sometimes quite rough around the edges. But if you are curious we’d be happy to have you check them out and give us feedback if something doesn’t work.

---

<div class="post-metadata">

### Author: ![Jandyman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandyman/32/12712_2.png) [@Jandyman](https://discourse.julialang.org/u/Jandyman)
#### Post date: [February 8, 2020, 6:13pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/4 "2020-02-08T18:13:46Z")

</div>

I will check Makie.jl and MakieLayout.jl and report back. I like the spirit of what is going on with Julia, and the momentum. I had found a temporary Matlab replacement with PyLab, but it isn’t exciting and Julia seems “just right”, as long the ecosystem gets there.

---

<div class="post-metadata">

### Author: ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)
#### Post date: [February 8, 2020, 6:17pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/5 "2020-02-08T18:17:12Z")

</div>

Usually I do something like:

```julia
using Plots
plotly()

```

Using the plotly backend will open the plot either in Atom or in Chrome and you cand zoom,pan,hover or save the plot.

---

<div class="post-metadata">

### Author: ![Jandyman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandyman/32/12712_2.png) [@Jandyman](https://discourse.julialang.org/u/Jandyman)
#### Post date: [February 8, 2020, 7:10pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/6 "2020-02-08T19:10:55Z")

</div>

Makie looks very cool. I did get various warnings and error running the test. I’ll attach them to the makie.jl Github page.

I did run a couple simple examples and the _contents_ of those plots don’t seem to be zoomable and pannable by default. Do you have a simple example that does make the contents zoomable and pannable?

plotly() does seem to be working, but I’m getting strange behavior. The first plot I did came up in the Safari browser. Then the second plot came up in the plot pane of Atom (but was zoomable and pannable, hooray).

Overall this is very encouraging.

Can someone tell me what the delays are when engaging new functionality, such as after running a Using statement for the first time and seeing the “precompiling” message? Is this just JIT compilation? Will these sorts of delays fade away as I get into a normal workflow? I’m doing a lot of new things, but often I’m waiting a _long_ time for a few lines of Julia to complete.

---

<div class="post-metadata">

### Author: ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)
#### Post date: [February 8, 2020, 7:24pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/7 "2020-02-08T19:24:59Z")

</div>

You can call `gui()` after `plot` and it appears in Safari.

---

<div class="post-metadata">

### Author: ![EHBaozi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ehbaozi/32/14854_2.png) [@EHBaozi](https://discourse.julialang.org/u/EHBaozi)
#### Post date: [February 8, 2020, 7:31pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/8 "2020-02-08T19:31:54Z")

</div>

It is indeed JIT compilation latency, and currently there is no good way to avoid that. (You can start julia with `julia --compile=min` to get rid of much of the latency but then you won’t get the performance of JIT compiled code and that particular commandline option often has weird behavior from my experience.)

The whole issue of JIT latency has been extensively discussed elsewhere (see [here](https://discourse.julialang.org/t/compiler-work-priorities/17623) and [here](https://discourse.julialang.org/t/roadmap-for-a-faster-time-to-first-plot/22956) for example).

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [February 8, 2020, 7:51pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/9 "2020-02-08T19:51:07Z")

</div>

You need the LAxis from MakieLayout.jl for zooming and panning 🙂 Short example to get you going:

```julia
using Makie
using MakieLayout

scene, layout = layoutscene()
display(scene) # or return scene to show it
ax = layout[1, 1] = LAxis(scene) # create axis and place in main layout
lines!(ax, 1:10, rand(10)) # draw lines into axis

ax2 = layout[1, 2] = LAxis(scene) # another scene next to the first one
heatmap!(ax2, rand(100, 100)) # draw a heatmap into that one

```

---

<div class="post-metadata">

### Author: ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)
#### Post date: [February 8, 2020, 8:50pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/10 "2020-02-08T20:50:04Z")

</div>

This is looking great!!!

If I may:

Perhaps there is a way to have the zoom box _a la_ plotly?

Also, `AbstractPlotting.inline!(false)` does not make it work in Juno plotpane, is it expected?

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [February 8, 2020, 9:00pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/11 "2020-02-08T21:00:54Z")

</div>

Box zoom is a good idea, I think that would need a flexible way to enable or disable though, because often in Makie you might want to have your own click-and-drag behavior for an axis and they shouldn’t clash. As an alternative, if you want to zoom x and y axes independently, you can just hold “x” or “y” while scrolling.

---

<div class="post-metadata">

### Author: ![ElOceanografo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eloceanografo/32/624_2.png) [@ElOceanografo](https://discourse.julialang.org/u/ElOceanografo)
#### Post date: [February 8, 2020, 9:21pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/12 "2020-02-08T21:21:26Z")

</div>

If you use either the PyPlot package or the `pyplot()` backend for Plots, and you disable the plot pane in the Juno options, you will get a pop-out Matplotlib plotting window that lets you zoom and pan. This is what I use a lot of the time. With two monitors, I keep the Juno open in one and the plot window open in the other.

---

<div class="post-metadata">

### Author: ![Jandyman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandyman/32/12712_2.png) [@Jandyman](https://discourse.julialang.org/u/Jandyman)
#### Post date: [February 9, 2020, 1:18am UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/13 "2020-02-09T01:18:35Z")

</div>

> [@jules](#):
>
> using Makie  
> using MakieLayout  
> scene, layout = layoutscene()  
> display(scene) # or return scene to show it  
> ax = layout[1, 1] = LAxis(scene) # create axis and place in main layout  
> lines!(ax, 1:10, rand(10)) # draw lines into axis  
> ax2 = layout[1, 2] = LAxis(scene) # another scene next to the first one  
> heatmap!(ax2, rand(100, 100)) # draw a heatmap into that one

I get the following error when I try to run the code:

[Info: Precompiling MakieLayout [5a521ce4-ebb9-4793-b5b7-b334dfe8393c]  
ERROR: LoadError: LoadError: LoadError: UndefVarError: @lift not defined  
Stacktrace:  
[1] top-level scope  
[2] include at ./boot.jl:328 [inlined]  
[3] include\_relative(::Module, ::String) at ./loading.jl:1105  
[4] include at ./Base.jl:31 [inlined]  
[5] include(::String) at /Users/andy/.julia/packages/MakieLayout/kxlvA/src/MakieLayout.jl:1  
[6] top-level scope at /Users/andy/.julia/packages/MakieLayout/kxlvA/src/MakieLayout.jl:32  
[7] include at ./boot.jl:328 [inlined]  
[8] include\_relative(::Module, ::String) at ./loading.jl:1105  
[9] include(::Module, ::String) at ./Base.jl:31  
[10] top-level scope at none:2  
[11] eval at ./boot.jl:330 [inlined]  
[12] eval(::Expr) at ./client.jl:425  
[13] top-level scope at ./none:3  
in expression starting at /Users/andy/.julia/packages/MakieLayout/kxlvA/src/lobjects/llegend.jl:28  
in expression starting at /Users/andy/.julia/packages/MakieLayout/kxlvA/src/lobjects/llegend.jl:1  
in expression starting at /Users/andy/.julia/packages/MakieLayout/kxlvA/src/MakieLayout.jl:32

---

<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: [February 9, 2020, 1:57am UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/14 "2020-02-09T01:57:40Z")

</div>

You can try InspectDR.jl: It is designed for panning/zooming (and more) in a popup window. Note that it is also designed to work with large datasets.

→ [GitHub - ma-laforge/InspectDR.jl: Fast, interactive Julia/GTK+ plots (+Smith charts +Gtk widget +Cairo-only images)](https://github.com/ma-laforge/InspectDR.jl)

### Issues

Apparently, there are still problems with the Gtk.jl module with respect to MacOS. I do not know why. However, if Gtk.jl works on your particular system, then InspectDR should work for you.

### Interactivity Examples

In addition to pan/zoom capabilities (see section on keybindings in Readme.md), you can add “delta” markers and move them around with your mouse:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/a/ea47220dc58eae97c9ed29dde1d46b4b8ced2d40.png)

Also, you can create bode plots where the x axes are tied together, and overlay vertical/horizontal markers where needed:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/e/5eb8fb0c221f7b1d3173393a9f3296bdcbca5677.png)

### Links

Sample plots can be found here:  
 → [FileRepo/InspectDR/sampleplots/README.md at master · ma-laforge/FileRepo · GitHub](https://github.com/ma-laforge/FileRepo/blob/master/InspectDR/sampleplots/README.md)

And the files for creating them here:  
 → [InspectDR.jl/sample at master · ma-laforge/InspectDR.jl · GitHub](https://github.com/ma-laforge/InspectDR.jl/tree/master/sample)

There are more examples of plots generated with InspectDR here:  
 → [FileRepo/SignalProcessing/sampleplots/README.md at master · ma-laforge/FileRepo · GitHub](https://github.com/ma-laforge/FileRepo/blob/master/SignalProcessing/sampleplots/README.md)

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [February 9, 2020, 11:49am UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/15 "2020-02-09T11:49:56Z")

</div>

That is weird, `@lift` is a macro in AbstractPlotting that should be available if you have that package. I’ve seen this before, though, the error just disappeared again and I don’t remember what the reason was. What are the versions that you’re using of MakieLayout and AbstractPlotting? It could be that something else holds MakieLayout back and you don’t get the version that correctly restricts AbstractPlotting to versions that have `@lift`…

---

<div class="post-metadata">

### Author: ![Jandyman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandyman/32/12712_2.png) [@Jandyman](https://discourse.julialang.org/u/Jandyman)
#### Post date: [February 9, 2020, 4:53pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/16 "2020-02-09T16:53:04Z")

</div>

(v1.3) pkg\> status MakieLayout  
Status `~/.julia/environments/v1.3/Project.toml`  
[537997a7] AbstractPlotting v0.9.17 #master ([GitHub - JuliaPlots/AbstractPlotting.jl: An abstract interface for plotting libraries, part of the Makie ecosystem.](https://github.com/JuliaPlots/AbstractPlotting.jl.git))  
[5a521ce4] MakieLayout v0.2.15

---

<div class="post-metadata">

### Author: ![mbaz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbaz/32/17295_2.png) [@mbaz](https://discourse.julialang.org/u/mbaz)
#### Post date: [February 9, 2020, 5:32pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/17 "2020-02-09T17:32:21Z")

</div>

> [@Jandyman](#):
>
> Plots you can edit, but specifically zoom and pan the _contents_ of the plot.

[Gaston.jl](https://github.com/mbaz/Gaston.jl), which is based on gnuplot, supports plots in separate windows and pan/zoom. To zoom, select a region using the right mouse button. Panning works but is a bit clunky: the mouse wheel scrolls in the vertical direction, and shift-wheel in the horizontal direction.

If you run Gaston in Juno (or Jupyter), it will default to producing inline SVG plots, which can’t be zoomed/panned (at least not without some special javascript incantation that I haven’t tried to figure out). You should be able to plot in a separate window and re-gain zoom/pan support by running `set(mode="normal")` – I haven’t tested this, though; let me know if you try it and doesn’t work.

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [February 9, 2020, 6:04pm UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/18 "2020-02-09T18:04:35Z")

</div>

Just installed a fresh environment with the exact same versions and don’t get that error… I don’t have an idea right now what the cause could be then

---

<div class="post-metadata">

### Author: ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)
#### Post date: [March 3, 2020, 9:11am UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/19 "2020-03-03T09:11:03Z")

</div>

> [@jules](#):
>
> This will give you plots that you can zoom and pan and MakieLayout.jl is even nicer than Matlab (in my totally biased opinion) for building up a layout of plots iteratively.

How do you come back to the initial configuration after a zoom/pan?

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [March 3, 2020, 9:37am UTC](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352/20 "2020-03-03T09:37:58Z")

</div>

Ah I should add that to the docs… ctrl + mouse click, or call `autolimits!` on the axis

[Next page](https://discourse.julialang.org/t/zoomable-and-pannable-plots-in-a-separate-window-atom-macos/34352.md?page=2)
