I am using CairoMakie on Ubuntu and saving plots as SVG.
When I open the SVG file with Inkscape to edit it, the file cannot be edited. It looks like a raster image. What is happening?
At first glance, this may seem like an Inkscape question, but I already checked with other SVG files and I can edit them with Inkscape. I also tried many tricks in Inkscape to make the CairoMakie-saved SVG files editable, without success.
So the problem is that SVG files saved using CairoMakie cannot be edited because they seem to be raster. I cannot access the different objects and paths. It only allows me to change the center of the SVG file. Do you have any idea?
I have the same problems when saving as svg even if I run CairoMakie.activate!(type = "svg"). However, a fine workaround is to save as pdf and then open the pdf in Inkscape. That provides you with a vector format.
I would suggest reporting a bug. It is probably just some silly omission in the save code. I am not particularly worried, as the exact format (pdf or svg) does not matter much to me, as long as it is actually a vector format (which it is in the case of pdf).
What plot objects are you using? There are certain operations where cairo just falls back to rasterization and svg supports a different subset than pdf
I am using lines and density, at least. They all produce rasters…
BUT, previously the same plots (using lines and density) were properly saved as SVG. Suddenly something happened, and they began to be saved as rasters.
That is why I was so confused. I did not change anything in my code and plots began to be saved as rasters. I think I installed a few packages, and I updated Ubuntu, but that is all. I guess maybe those packages changed something ?
Hm density drops down to poly, might drop down to mesh. If dispatch in CairoMakie changed again so mesh is hit, that could cause rasterization. Can you leave out density and check if it’s fine?
I’ll check it out later, something is fishy then. But just to make sure, this happens with save("test.svg", fig) or only with displaying in VSCode or something comparable?