Skip to content
New issue

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

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

Already on GitHub? # to your account

Bug: Offline Static Image Export #596

Closed
keithjjones opened this issue Oct 26, 2016 · 10 comments
Closed

Bug: Offline Static Image Export #596

keithjjones opened this issue Oct 26, 2016 · 10 comments

Comments

@keithjjones
Copy link

https://plot.ly/python/offline/#static-image-export

This doesn't work. You still have to open the html file to get the image. Clicking on the "Save As" camera button produces a better picture (not skewed) if you are going to open the HTML file to get an image.

@cldougl
Copy link
Member

cldougl commented Oct 26, 2016

@keithjjones this example is working for me. This functionality was added in version 1.12.2
https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md#added-3

Please confirm you're using an updated version of our python package and if you're still having the issue perhaps let us know what version of python you're using / include the code that is not working for you.

@keithjjones
Copy link
Author

My version:

>>> from plotly import __version__
>>> print(__version__)
1.12.9

and Python:

Python 3.5.2 (default, Oct 11 2016, 05:05:28) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

I'm using the exact command line in that page, except I'm using Python and not iPython. I either have to auto_open=True and save the image or double click on the html file and save the image.

@cldougl
Copy link
Member

cldougl commented Oct 26, 2016

Yes that example using plot() is for python. You should use iplot() if you're using ipython. Are you receiving an error?

@keithjjones
Copy link
Author

I'm using pure python. It's the offline.plot function that I'm using.

No errors. It generates the html file fine. When I open the HTML file it then asks if I want to save the image. I don't want to open the HTML file to get an image, or I could just click on the "Save As PNG" and that render tends to look much better.

It works this way on Windows 7 and Mac for me.

@keithjjones
Copy link
Author

That example includes:

offline.init_notebook_mode()

That can only be run inside iPython. But the plot is using "plot".

@cldougl
Copy link
Member

cldougl commented Oct 28, 2016

I see, you're trying to generate the graph without opening the html file. Thanks for letting us know about the issue in the example, I've updated the documentation to reflect that you must open the file. It looks like this feature was added with the intention of opening the plot to save the image.

@keithjjones
Copy link
Author

Ok thanks.

@cldougl
Copy link
Member

cldougl commented Nov 29, 2016

Hey @keithjjones - the documentation has been updated to note this method. We've recently removed the alert when downloading offline images (v 1.12.10) but have decided to keep the plot() call the same, i.e. you must open the plot in order to download the image. I'm going to close this issue since it's not a bug. You can always open a feature request issue if you feel the image should be downloaded without opening the plot (though that's not in our current plan just at this time). Thanks again for noting the documentation issue!

@cldougl cldougl closed this as completed Nov 29, 2016
@keithjjones
Copy link
Author

@cldougl is there a way to open a feature request issue that is different than Github issues? I do not understand.

@jonmmease
Copy link
Contributor

Update: Programmatic static image export support has been released in 3.2.0: See https://medium.com/@plotlygraphs/plotly-py-end-of-summer-updates-5422c98b9058

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

No branches or pull requests

3 participants