You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Offline way to programmatically save graph as PNG? #483
Chrome under Windows 10 is not working with image download (both programmatically and using mouse to click the camera thumbnail)
It was run with the commit 9e52ce4. (17 Jun 2016 16:39)
Maybe the offline js module should be synchronized with plotly.js since it has been fixed in plotly.js #604
@cldougl This currently opens a web browser which requests to safe the picture. If you try to export multiple PNGs this is not really a usable way. It would be nice to directly export as PNG file from python. Could you please reopen this issue?
Reacted by Roberto Ulloa, Jonatan Samoocha, Robin Rosenstock, Fabian Schönfeld, Vipin Ajayakumar, Jordan Koncz, Sergey Akentev, Tejas Lodaya, nikkarus and Kent Kostelac
@cldougl, I second @NicoHood , a programmatic way of exporting images in offline mode would be really useful - particularly for the use case of needing to export multiple images. At the moment, it's a pain!
Reacted by Jordan Koncz, efayadspecific, Sergey Akentev and Stephen J Bush
yes, please!! I need to programmatically create heatmaps from 2000+ Pandas data frames. having each open up in a browser is not tractable, in my opinion. thanks!
Since this has the most unique users of issues requesting this (there are several), would anyone here be capable to implement something if the plotly team sketched a possible method?
As all of the closed issues suggest, they probably aren't going to do this... but perhaps we could. This was my pitch in the newest incantation of this request, #880 . Perhaps if you show your support via programming chops we can get a direction to take and collaborate?
@jwhendy I hope something comes off this. I'm definitely willing to help, but I don't have any previous experience of contributing source code even in Python. JavaScript is something I've just started learning. So, may be limited in what I can do!
I do think this is a key feature that plotly is lacking, potentially even one that prevents a large population of data analysts from adopting plotly. I use plotly to probe all of my data since it's interactive, and then I have to use matplotlib to save them as plots to share with my colleagues because I'm generating hundreds of plots at a time!!
@bluprince13 see the most recent post at #880. I was able to make some progress on two potential methods. Feel free to try them out! I'm hoping @cldougl suggests a place one of them could fit in the library, and I'll make a pull request. Likely this will require someone more advanced than me to take a look and give input.
Activity
yankev commentedon May 30, 2016
@evrenkutar Currently the procedure in which we turn plots into static images requires communication with our servers.
jackparmer commentedon May 31, 2016
@evrenkutar @yankev If you're using Jupyter notebook, you should be able to access this toImage() routine programmatically in Python:
https://plot.ly/javascript/static-image-export/
@cldougl @yankev Can you please look at how the R client does this and add official support (and docs) for the Python client?
hyliu1989 commentedon Jun 17, 2016
Chrome under Windows 10 is not working with image download (both programmatically and using mouse to click the camera thumbnail)
It was run with the commit 9e52ce4. (17 Jun 2016 16:39)
Maybe the offline js module should be synchronized with plotly.js since it has been fixed in plotly.js #604
yankev commentedon Jun 18, 2016
@hyliu1989 Thanks for the reminder. We should be pushing a new version up on
pipearly next week.cldougl commentedon Nov 1, 2016
docs of offline image exporting can be found here: https://plot.ly/python/static-image-export/#export-static-image-offline
NicoHood commentedon Jul 5, 2017
@cldougl This currently opens a web browser which requests to safe the picture. If you try to export multiple PNGs this is not really a usable way. It would be nice to directly export as PNG file from python. Could you please reopen this issue?
As a workaround I found this post which converts the data into matlab. However this did not work for me with the latest plotly version.
https://stackoverflow.com/questions/40243446/how-to-save-plotly-offline-graph-in-format-png
bluprince13 commentedon Nov 16, 2017
@cldougl, I second @NicoHood , a programmatic way of exporting images in offline mode would be really useful - particularly for the use case of needing to export multiple images. At the moment, it's a pain!
efayadspecific commentedon Dec 6, 2017
yes, please!! I need to programmatically create heatmaps from 2000+ Pandas data frames. having each open up in a browser is not tractable, in my opinion. thanks!
jwhendy commentedon Dec 26, 2017
Since this has the most unique users of issues requesting this (there are several), would anyone here be capable to implement something if the plotly team sketched a possible method?
As all of the closed issues suggest, they probably aren't going to do this... but perhaps we could. This was my pitch in the newest incantation of this request, #880 . Perhaps if you show your support via programming chops we can get a direction to take and collaborate?
bluprince13 commentedon Dec 26, 2017
@jwhendy I hope something comes off this. I'm definitely willing to help, but I don't have any previous experience of contributing source code even in Python. JavaScript is something I've just started learning. So, may be limited in what I can do!
I do think this is a key feature that plotly is lacking, potentially even one that prevents a large population of data analysts from adopting plotly. I use plotly to probe all of my data since it's interactive, and then I have to use matplotlib to save them as plots to share with my colleagues because I'm generating hundreds of plots at a time!!
jwhendy commentedon Dec 27, 2017
@bluprince13 see the most recent post at #880. I was able to make some progress on two potential methods. Feel free to try them out! I'm hoping @cldougl suggests a place one of them could fit in the library, and I'll make a pull request. Likely this will require someone more advanced than me to take a look and give input.
jackparmer commentedon Dec 30, 2017
Update on this issue from Plotly: #880 (comment)
eagleEggs commentedon May 9, 2018
FYI this is now possible with one line after setting your data and figure:
edit [051518]: actually this doesn't work :/
data = Data([tasks, tasks2, tasks3])
fig = Figure(data=data, layout=layout)
offline.iplot(fig, filename='graph', image='png')
It saves to the /Downloads directory.
https://gist.github.com/eagleEggs/c441ffa88a90a8a360d771fae3ba2d8e
Looking for a way to change that default directory currently...
jonmmease commentedon Sep 5, 2018
Update: Offline programmatic static image export support has been released in 3.2.0: See https://medium.com/@plotlygraphs/plotly-py-end-of-summer-updates-5422c98b9058