UndefVarError: `savefig` not defined

Hello everyone,

After a long run and installing the newest version of Julia (1.9) I still get a frustrating error (that I have written in the title) when trying to save a figure

Here is my plain code (minimal example)

using Makie, GLMakie

f = Figure(resolution = (1920, 1280), fontsize = 36)

ax = Axis(f[1, 1], aspect = DataAspect(), backgroundcolor = "white") 
display(f)

savefig(f, "test.png")

I’m running it in Visual Studio

Anyone made it working? I spend a lot of time on this. Also I didn’t seem to find another function for saving a figure, else I had tried it.

Makie does not provide a function called savefig. You likely mean save.

Googling “Makie save figure”, this is what comes at the top of the list.

Thanks, I looked the whole time for saving figures in Julia generally.

Now this is not related to the question anymore, but while we are at it -

How to set the fontsize of the title and the figure individually?

If I rund

f = Figure(resolution = (1920, 1280),fontsize = 42)

ax = Axis(f[1, 1], aspect = DataAspect(), backgroundcolor = "white", spinewidth=2, 
          xticks=1:10,  
          yticks=1:10,
          xlabel = "xlabel", xlabelsize=34,
          ylabel = "ylabel",ylabelsize=34, title = "myTitle", titlefontsize = 12)

x = 1:10; y = x; 

lines!(x,y)

The global fontsize is set to 42 even if I specified for the title size 12

Pretty sure it’s titlesize, doesn’t it error with the wrong keyword?

okay great thanks, that immediately does the trick :smile: