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.

[Feature Request] Simplify saving to PNG

See original GitHub issue

As a new user looking for better grammar and control than pandas and matplotlib, this has been my adoption experience with Altair:

  1. Great documentation, able to start plotting right away.
  2. Support for faceting; nice, I will commit to learning this “language”.
  3. Go to save to PNG.
  4. Need other pip package altair_saver; install it.
  5. Need geckodriver from package manager; install it.
  6. Got chromedriver error and had to search outside documentation for solution.
  7. Even after sorting that, encountered deprecation error.

Problem is I need two dependencies for it to do something I would expect it to support natively: save as PNG. These two dependencies are not able to be tracked as dependencies as far as I know, meaning if I pip uninstall altair I’d like it to take altair_saver and geckodriver with it. I would accept needing just altair and altair_saver from pip.

Further, once I got the dependencies sorted, I had to search outside the instructions to learn that if I’m using geckodriver I need to call save with save(..., webdriver="firefox").

Even after overcoming that, I got hit with an error due to a recent selenium upgrade with breaking dependencies, as noted in this issue.

Sure if I’m making one plot, it’s not too bad to output .html, view it in firefox, and save to PNG using the dot menu. The problem is it’s never just one plot. I usually have a program that analyzes my dataframe and generates many plots which I’d like to name then and there based on what I’m doing then and there in the program.

A potential solution would be providing an Altair package or script, or linking to an existing pip package that lets me output a directory of .html plots, and convert them all to .png, preserving the basenames.

Best case scenario: chart.save("to.png") just works.

I’m taking the time to write this to improve this otherwise powerful, promising tool, and possibly, adoption thereof. I turned away from Altair simply because the hurdle to save to PNG was disproportionately and unexpectedly large. I came back because pandas and matplotlib is too restricting and indirect, and the stifling of this became significantly clearer after my brief work with Altair. It’s worth noting I also tried plotnine in my search, and I found Altair’s documentation to be better, and syntax to be much more direct. Altair had more pleasing default colors and conveniently used labeling from the df, without intervention.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:32 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
daylinmorgancommented, Aug 21, 2022

Update: New release has some additional wheels (linux-glibc, win-x64, and macos-x64) folks can try locally, also fixed the issue with windows.

1reaction
jonmmeasecommented, Oct 19, 2022

Thanks for the kind words on vl-convert @daylinmorgan, and for your work on okab.

Ideally altair’s native save function could attempt to load vl-convert once the API is stable and use it’s conversion functions before falling back on altair_saver

This would be my preference, and I’d be happy to work on a PR for this soon

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simplify "SAVE AS" - Adobe Support Community - 13305012
The 'Save as' function used to be perfect with one page and one selection drop down menu. Nice and simple. Now it has...
Read more >
Illustrator (Desktop) Feature Requests: File Save, Import and ...
1. File > Save a copy, 2. Change format to PDF, 3. Remove “ copy” from filename, 4. Change directory, 5. Click Save,...
Read more >
Feature request: save as: png, tif, jpeg etc. : r/Affinity - Reddit
If I close the document it will remind me that the file has not been saved (but it has been 'exported'). most other...
Read more >
Export Simplified Image to PNG - NI Community
Export Simplified Image to PNG ... Labels: UI & Usability ... Bmp is a kind of uncompressed format thats why its here i...
Read more >
New in town — Submit a feature idea - Mural Community
A feature idea submitted may or may not be put into development ... problem you are trying to solve, why this helps everyone;...
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