Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: Download matplotlib figure to client browser #3446

Closed
petrushy opened this issue Jun 19, 2013 · 2 comments
Closed

Feature suggestion: Download matplotlib figure to client browser #3446

petrushy opened this issue Jun 19, 2013 · 2 comments
Milestone

Comments

@petrushy
Copy link

The plt.savefig saves the figure on the ipython notebook server. It would be great to be able to download the figure (preferable as pdf) to the client browser directly. Either as a python command in a cell or as a button on the figure (save as..), which would trigger a browser file download / open.

@Carreau
Copy link
Member

Carreau commented Jun 19, 2013

This is true for any file type, not only figures saved with savefig. And this is why we provide FileLink.
The following does what you expect. You might need to use display if have code after publishing the link:

from IPython.display import FileLink, display
plot(range(10))
savefig('foo.pdf')
FileLink('foo.pdf') #wrap in display if code after.

@Carreau Carreau closed this as completed Jun 19, 2013
@takluyver
Copy link
Member

Some kind of save button might be useful when we add more interactivity
with plots, though. You can already right click on the image and save it,
but that can't save a vector form (assuming you're using the default, png
display)

On 19 June 2013 15:15, Matthias Bussonnier notifications@github.com wrote:

This is true for any file type, not only figures saved with savefig. And
this is why we provide FileLink.
The following does what you expect. You might need to use display if have
code after publishing the link:

from IPython.display import FileLink, display
plot(range(10))
savefig('foo.pdf')
FileLink('foo.pdf') #wrap in display if code after.


Reply to this email directly or view it on GitHubhttps://github.com//issues/3446#issuecomment-19686592
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants