VSCode CairoMakie Zoom

Is there any way to zoom in VSCode for plots created by CairoMakie? I often visualize high resolution images with many annotations and I can’t seem to find any way to zoom in so I can see the details.

Bypassing VSCode and using something like GLMakie would work in theory, but the issue is my work VM is a potato without 3d acceleration. So I use VSCode remote development over SSH.

Works good for me.

You just save your figure produced by CairoMakie via save("f.pdf", f).
And then you check that pdf figure via VSCode extensions, e.g mine is LaTeX Workshop.

1 Like

I tried LaTeX Workshop but it seems the resolution is limited when I zoom in compared to just saving the image as a png and opening it in a seperate image viewer.

EDIT: Just noticed I can load the .png into VSCode and actually zoom, it just can’t be done in the Julia Plots window.

I’ve been using julia with VSCode everyday. But I don’t use any julia extensions. I think the julia software itself works well.

hard to understand from my perspective. Are you involving very tiny texts in your image? Why? Otherwise .pdf figures should be of high quality.

I’m visualizing high resolution medical images, and there are precise annotations overlaying them that are fine enough to not block key details (ie vertebral endplates).

Just use PyPlot or PythonPlot. I know I won’t receive any likes for this answer, but if you need high-quality vector graphics that can be zoomed interactively, this is still the best choice. OK, medical images are not vector graphics. But then, why not use GLMakie?

If it needs the plotpane you can also always just switch from CairoMakie to WGLMakie, which allows you the same interactivity like GLMakie, just in the browser (plotpane → electron window).

2 Likes

It sounds like you don’t mean interactivity with zooming into an axis but literally zooming into the image rendered to the plot pane? That works for me, alt and scroll I think

2 Likes

Do you know if WGLMakie can work with using VSCode over SSH? When I generate a plot it shows that there is a plot in VSCode, but I can’t actually see or interact with it.

Yes, but it doesn’t work for me. Hearing that it works for you, I may have to check and see if the remote desktop software I am using is somehow interfering with the key combination, or maybe my window manager (xfwm4 which by default has a desktop level zoom with ALT+SCROLL).

EDIT:

So apparently there is something strange going on with my remote access software (Splashtop), the menu key + scroll works. In xev the key codes are the same for that and left ALT, but for some reason it works and left alt does not. I can’t explain it. On my desktop, ALT+SCROLL works just fine.