Is there a way to display a CairoMakie plot in a Gtk/Qt window in remote X11 session

I am doing data analysis on a remote server and trying to utilize Makie to produce interactive quick plots. I can’t use GLMakie and using something like Jupyter notebooks remotely is complicated on my cluster. Pretty much the only option I have for quick analysis/plotting is a terminal with interactive Julia session and X11 forwarding through SSH. Is there some package on top of CairoMakie, which sends a plot to Gtk or Qt window, similar to python’s matplotlib? Saving plot to a temporary file and displaying it with ImageView works, but is not very convenient. I tried to follow this example, but it works kind of poorly. PythonPlots works fine for my purpose, but I am trying to get rid of python dependencies in my work. I can’t believe that something like matplotlib Gtk/Qt backends does not exist for Makie.

You can try SixelTerm.jl, like here.

Another idea that I don’t know if will work. You can do CairoMakie.Makie.inline!(false), plot something and see if it launches an image viewer. I read about it here

I have this problem at work and my solution is to use a distributed computing setup (Multi-processing and Distributed Computing · The Julia Language) where I do most of my work locally, but pass high-resource parts of the code to worker node(s) that’s defined on the server. The steps are:

  1. Set up my code and run Julia locally
  2. Load Distributed.jl and initiate a worker node on server (the same version of Julia must be installed on the server)
  3. Also have a network drive mapped through which I can access small files from the server as needed
  4. Have a config file (~/.julia/config/startup.jl) existing at both locations where certain environment variables are set so that Julia can work with network paths seamlessly whether it’s running locally or on the server
  5. Run my code locally and visualize things however I like, except use remotecall_fetch or @spawnat to access and work with large files or to do CPU-intensive work, then fetch back an aggregate, or small part of the result as needed, to my local session for for visualization

It adds complication to parts of the code unforuntately, but besides that I’ve found this to be a very satisfactory solution.

If you can ssh forward, you should be able to use wglmakie…that should be much easier than other solutions. Or x forward glmakie, which should also work with most servers.

Hi some discussions also here:

I especially like the solution using RemoteREPL.jl.
There is also an example on the docs
As a tip, take care to reproduce the environment you have on the server locally, because otherwise you will not be able to locally evaluate types that are only known in the remote session. Then just add GLMakie on top and happy plotting :slight_smile:

Thank you all who responded. Keeping data remotely and making plots locally is not an option for me, because my cluster is behind a bastion login node and passwordless access is not allowed. Besides, size of data for some plots is not small for frequent transfers over network. I need to run julia and plots remotely. X11 forwarding works. GLMakie does not work, because OpenGL drivers installed on the cluster are too old and I can’t change this. None of terminals installed on my workstation supports Sixel and I also can’t change this. Makie.inline!(false) works, but allows only one window with plots at a time, which is a pity limitation. It also creates a temporary file in the packages area, which is against julia philosophy as far as I understand (should not scratch spaces be used for such purpose?). The most flexible way in my situation is still to produce temporary png files and display them with image viewer. Or keep using PythonPlots for interactive plotting.

What about port forwarding with ssh & WGLMakie?

as long as you can ssh, RemoteREPL.jl should also work. some altenatives are also in the docs How To · RemoteREPL.jl

I tried WGLMakie, but no plots show up and no error messages. I don’t know why could this happen.

EDIT: I think, there is just no GUI browser installed on the cluster.