Saving VegaLite Plots

I’m having some trouble saving plots I’ve created using VegaLite. Here is what I’ve been trying.

grph1 |> save("/PATH/figure.png")

I get this error.

MethodError: no method matching save_(::FileIO.File{FileIO.DataFormat{:PNG}}, ::Nothing)
Closest candidates are:
  save_(::FileIO.File{R}, ::AbstractArray; permute_horizontal, mapi) where R<:FileIO.DataFormat at /Users/chand/.julia/packages/QuartzImageIO/AjiIs/src/QuartzImageIO.jl:223

I just need to save these plots in some way so I can add them to a document. Is there another way to do this? Thank you.

You may try if this works for you:

julia> using FileIO

julia> p |> FileIO.save("/PATH/figure.png")

This works perfectly, thank you.

1 Like