question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

chart.save does not support pdf as shown in docs

See original GitHub issue

The 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:closed
  • Created 3 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ksk73commented, Jul 14, 2022

Thanks a lot 😃 It is working now.

1reaction
jakevdpcommented, Apr 4, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Save or publish your chart - Google Docs Editors Help
Save a chart to your computer. You can download charts in SVG, PNG, or PDF format. On your computer, open a spreadsheet in...
Read more >
How To Save Microsoft Excel Chart (or Charts) to PDF
In this tutorial, we'll show you how to quickly save a single Microsoft Excel chart to PDF & export multiple charts from Excel...
Read more >
Save a diagram as an image or a PDF file - Microsoft Support
... people who don't have Visio, publish a diagram, or prevent reviewers from making changes, save it as an image file or in...
Read more >
Save a chart as a picture - Microsoft Support
Supports 256 colors and no image data is lost when the file is compressed. JPEG File Interchange Format (.jpg). Best used for pictures...
Read more >
Troubleshooting Charts | Image Charts - Google Developers
My Chart Isn't Showing! This page describes some debugging tips when your charts don't seem to be working. General ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found