# Makie and X11 forwarding

**URL:** <https://discourse.julialang.org/t/makie-and-x11-forwarding/91975>\
**Category:** Visualization\
**Tags:** makie, x11\
**Created:** [December 21, 2022, 8:52pm UTC](https://discourse.julialang.org/t/makie-and-x11-forwarding/91975 "2022-12-21T20:52:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![wsshin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsshin/32/360_2.png) [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Post date:** [December 21, 2022, 8:52pm UTC](https://discourse.julialang.org/t/makie-and-x11-forwarding/91975/1 "2022-12-21T20:52:52Z")

</div>

I am developing in a remote server. I am connected to the server from my local machine via SSH. To enable X11 forwarding, I connect using the `-Y` option (i.e., `ssh -Y`). This allows me to use the GUI interface of the app running on the remote server; for example, if I start MATLAB form the terminal connected to the remote server, the MATLAB GUI shows up in an X-window.

Now, in the same environment, I’m not sure how to display Makie plots. An example script I run is

```julia
using CairoMakie

fig[1,1] = Axis(fig)
xs = range(0, 2π, length=100)
lines!(xs, sin.(xs))
display(fig)

```

but the last line just returns `Figure()` without showing any figure; it does not even open an X window.

Is there a way to plot Makie figures from Julia running on the terminal connected to a remote server?

---

<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:** [December 21, 2022, 9:15pm UTC](https://discourse.julialang.org/t/makie-and-x11-forwarding/91975/2 "2022-12-21T21:15:46Z")

</div>

Maybe with GLMakie? CairoMakie doesn’t have windows, it mostly outputs pngs or svgs to plot panes or other compatible displays on the stack.

---

<div class="post-metadata">

**Author:** ![j\_u](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/j_u/32/219081_2.png) [@j\_u](https://discourse.julialang.org/u/j_u)\
**Post date:** [December 22, 2022, 1:47am UTC](https://discourse.julialang.org/t/makie-and-x11-forwarding/91975/3 "2022-12-22T01:47:03Z")

</div>

Maybe ElectronDisplay.jl? Just a guess, never used it with X11 forwarding.

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [December 22, 2022, 10:34am UTC](https://discourse.julialang.org/t/makie-and-x11-forwarding/91975/4 "2022-12-22T10:34:29Z")

</div>

Is displaying the figure in the terminal an option ? If your terminal supports them, you can use `Sixel`s and get decent results.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [December 22, 2022, 12:24pm UTC](https://discourse.julialang.org/t/makie-and-x11-forwarding/91975/5 "2022-12-22T12:24:25Z")

</div>

> [@j\_u](#):
>
> Maybe ElectronDisplay.jl? Just a guess, never used it with X11 forwarding.

EDIT: wrong quote

Yes, worked. Just tried it, had to install some missing libraries for CentOS, but after 1-2 hours it shows CairoMakie plots in an electron display via X on a Windows 10 desktop (XServer Xming).

Before I started I made sure to open a xterm to be sure that X system is doing as expected.

The above mentioned library are not needed for xterm, but for ElectronDisplay.jl (e.g. at-spi2-atk, gtk3-devel, libXScrnSaver). And .julia/artifacts/8731693ea495ec92614ea8a5da62f8e66909f0c1/chrome-sandbox needs to be:  
-rwsr-xr-x. 1 root root 6322128 22. Dez 12:57 .julia/artifacts/8731693ea495ec92614ea8a5da62f8e66909f0c1/chrome-sandbox  
but this is told by electron when used.

SSH is putty with X11 forwarding enabled.

---

<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:** [December 22, 2022, 12:25pm UTC](https://discourse.julialang.org/t/makie-and-x11-forwarding/91975/6 "2022-12-22T12:25:11Z")

</div>

> [@oheil](#):
>
> but after 1-2 hours it shows CairoMakie plots in an electron display

Hope that wasn’t compilation latency 😉

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [December 22, 2022, 12:27pm UTC](https://discourse.julialang.org/t/makie-and-x11-forwarding/91975/7 "2022-12-22T12:27:52Z")

</div>

> [@jules](#):
>
> Hope that wasn’t compilation latency 😉

Sorry for wrong quote (edited above)  
Anyways: TTFP is quite good considering what’s all needed in this special case.

---

<div class="post-metadata">

**Author:** ![wsshin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsshin/32/360_2.png) [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Post date:** [February 27, 2023, 9:46pm UTC](https://discourse.julialang.org/t/makie-and-x11-forwarding/91975/8 "2023-02-27T21:46:33Z")

</div>

Thanks @t-bltg! [SixelTerm.jl](https://github.com/eschnett/SixelTerm.jl) built using Sixels.jl works perfectly for me. It displays CairoMakie figures in the terminal directly. Because X11 forwarding was not working properly for GLMakie, I had to rely on UnicodePlots.jl to display the results calculated on a remote Linux cluster, but now I can use CairoMakie.jl and SixelTerm.jl.

Here is a screen capture showing how it works:

 ![Screenshot 2023-02-27 at 16.45.36](https://global.discourse-cdn.com/julialang/original/3X/6/0/60b268c222683600a4195b88d6634d4b4d3097f1.png)
