Error saving plots in Makie

Hello Everyone,

I was trying to save my plot as png images using Makie.jl in a for loop which constantly updates the plot.

Here is my code snippet which saves the plot:


where file_no is the iterable variable in the for loop and changes value.

This is the error I get:

SystemError: opening file "Frame:\\ 1.png": Invalid argument

var"#systemerror#69"(::Nothing, ::typeof(systemerror), ::String, ::Int32)@error.jl:174
var"#open#636"(::Bool, ::Nothing, ::Nothing, ::Nothing, ::Bool, ::Nothing, ::typeof(open), ::String)@iostream.jl:293
var"#open#637"(::Bool, ::typeof(open), ::String, ::String)@iostream.jl:355
open(::String, ::String)@iostream.jl:355
var"#open#355"(::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(open), ::Makie.var"#931#932"{Float64, Float64, DataType, Makie.Scene}, ::String, ::Vararg{String})@io.jl:328
save(::FileIO.File{FileIO.DataFormat{:PNG}, String}, ::Makie.Figure)@display.jl:226
var"#save#929"(::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(, ::String, ::Makie.Figure)@display.jl:217
save(::String, ::Makie.Figure)@display.jl:217
top-level scope@Local: 133

I can't figure out the error, any help would be appreciated. Thanks.

I think a : in a filename is not allowed


Hi again @jules

Thanks for the quick response. Removing ‘:’ in the filename fixed the error.

In Windows; MacOs, Linux and more Unix like, does accept : as part of a filename. :slight_smile:

(Not that I recomend using it. :sweat_smile: )