chart.save does not support pdf as shown in docs
See original GitHub issueThe docs for saving charts show chart.save('chart.pdf')
as one of the options, but running that results in ValueError: unrecognized format: 'pdf'
, even though altair_saver
is installed and from altair_saver import save; save(chart, "chart.pdf")
works.
By contrast, chart.save("chart.svg")
works fine.
Looking at the docstring of Chart.save
, it looks like pdf isn’t even supposed to work: “Supported formats are json, html, png, svg”. But maybe it’s just a matter of wiring it up?
If the issue is more complicated than that (maybe because Chart.save
is currently hardwired to use the Selenium backend, which doesn’t offer pdf export?), then I would suggest just removing chart.save('chart.pdf')
from the code example and refer users who are interested in pdf export functionality to altair_saver
’s docs 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (5 by maintainers)
Top GitHub Comments
Thanks a lot 😃 It is working now.
What error do you get when trying to save a png? I’m surprised that doesn’t work, because (unlike PDF) it’s covered in the test suite in several places.