Add png and jpeg support to ggsave
It seems that ggsave in lets-plot-kotlin supports more file formats like png and jpeg. Is there a specific problem with the python version for not supporting these formats?
Yes, it turned out to be not a trivial task in Python so we put it away for a while.
I understand. A workaround I am using right now is the cairosvg package.
from cairosvg import svg2png
...
p = ggplot(..) + ...
ggsave(p, filename='mysvg.svg', ...)
svg2png(url='mysvg.svg', write_to='mypng.png')
For anyone who is interested in saving the plots as png files.
Looks good! One possible issue might be their LGPLv3 license. Its copyleft-type license and we possibly are not allowed to bundle CairoSVG with Lets-Plot or even just hardcode a dependency on CairoSVG. But this need to be checked.
I am no legal expert but it seems that it does not affect your license if you use the library as it is.
I've ask our legal dept for clarification. I hope you are right.
They said that we can use CairoSVG but we shouldn't install it by default and instead should prompt user to install CairoSVG himself when required.
I just tested CairoSVG and found that almost everything works fine except a style="font:..." we use for some parts of a plot. It will take some time to switch to font-family, font-size and other properties that are compatible with CairoSVG.