Open ericphanson opened 3 years ago
We don't have jpg output anymore. That's just because Cairo has only png output and you can of course convert to jpg, but that can only lower your quality. So it didn't really seem sensible to include it. Then we could as well offer every file format that ImageMagick can convert to, which is pretty confusing I think.
The second thing errors because the mutating plotting functions all return plot objects, and you can't save those. The first one returns FigureAxisPlot
which together with Scene
and Figure
works for saving.
Ok, makes sense. I wonder if a more clear error can be thrown for CairoMakie.save("fig2.png", fig2)
? It dumps a bunch of FileIO stuff currently.
you mean overload AbstractPlot
for saving with an error-message like "don't do this, save the scene/ figure" because that's something people could do often?
Yeah, I think that would help. It was confusing to me especially because I was getting that same message due to bugs (i.e. when saving a scene/figure) until I updated and switched to CairoMakie master. So IMO a custom error message would help make it clear how you're supposed to use these things and when it's an unexpected error vs an expected one.
I see, and I can imagine people do this often just because the API differs a bit from Plots.jl
I guess jpeg is a wont-fix for us which leaves a better error for save(..., plot)
as TODO?
with