Makie and X11 forwarding

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

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?

1 Like

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

1 Like

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

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

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.

1 Like

Hope that wasn’t compilation latency :wink:

2 Likes

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