Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

JupyterLab saving plots #74

Closed
teucer opened this issue Jul 8, 2020 · 5 comments
Closed

JupyterLab saving plots #74

teucer opened this issue Jul 8, 2020 · 5 comments

Comments

@teucer
Copy link

teucer commented Jul 8, 2020

It seems that altair is able to save plots out of the box using actions. Could this be leveraged to save the plots to png/svg programmatically?

@jakevdp
Copy link
Member

jakevdp commented Jul 8, 2020

There is information on programmatically saving charts here: https://altair-viz.github.io/user_guide/saving_charts.html

If by leveraging actions, you mean programmatically clicking the actions buttons in Jupyter via javascript injected into the notebook, I have not tried that but it should be possible in principle.

@teucer
Copy link
Author

teucer commented Jul 8, 2020

I have seen the link and understand why it is required.

However, the need to install many tools to "just" save the chart as a png is probably not very user-friendly. Having it integrated in the main package would be more productive in my opinion.

@jakevdp
Copy link
Member

jakevdp commented Jul 8, 2020

Having it integrated in the main package would be more productive in my opinion.

That would be great, but there's not really any way to do that. Rendering charts currently requires a javascript environment: you can either use a browser to render the charts manually (as in Jupyter/JupyterLab) or render them automatically via extra dependencies (nodejs-based command-line tools, or selenium working with an appropriate headless browser are the two methods I'm aware of). I don't know of any way around that.

If you have specific ideas, I'm happy to hear them!

@teucer
Copy link
Author

teucer commented Jul 9, 2020

What about creating platform specific executables using e.g. pkg?

@joelostblom
Copy link
Member

Since Altair 5.2, the functionality of Altair Saver is now available in Altair via the vl-convert package. Most of the functionality has been available since 5.0, and the main addition in 5.2 was PDF export. See the docs on how to save charts for more details.

We are going to archive this repo, so I'm closing all the open issues and PRs before doing so. Try out the new options for saving charts mentioned above and if you run into issues, please open an issue directly in the altair or vl-convert repo.

@joelostblom joelostblom closed this as not planned Won't fix, can't repro, duplicate, stale Mar 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants