marimo icon indicating copy to clipboard operation
marimo copied to clipboard

Save altair charts as pdf

Open michaelsch71 opened this issue 1 year ago • 1 comments

Description

I am hoping to be able to save altair charts as pdf from the burger menu of the displayed chart. Right now "Save as SVG" and "Save as PNG" are already available. Still it would be great to save as pdf also, which is one of the most popular formats to save graphics in a vector format.

Suggested solution

Add a "Save as PDF" version to the burger menu. Altair already has the option to save as pdf internally, by just calling chart.save("filename.pdf"). So I hope this can be used to add the requested feature

Alternative

No response

Additional context

No response

michaelsch71 avatar Jun 24 '24 06:06 michaelsch71

@michaelsch71 - we welcome the contribution if you'd like to add support for this.

if you don't want to (that's ok!), you can roll this yourself pretty easily with mo.ui.button and following https://altair-viz.github.io/user_guide/saving_charts.html#png-svg-and-pdf-format

you could even pull this out to its own file and import it into your notebook if you'd like to re-use it across multiple notebooks.

mscolnick avatar Jun 25 '24 01:06 mscolnick