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

Have iplot return static image format of the plotly plot #1

Closed
ellisonbg opened this issue Dec 8, 2013 · 5 comments
Closed

Have iplot return static image format of the plotly plot #1

ellisonbg opened this issue Dec 8, 2013 · 5 comments

Comments

@ellisonbg
Copy link

The iplot function produces an HTML representation of a plotly plot for usage in the IPython notebook. IPython also supports converting notebooks to LaTeX/PDF documents through IPython.nbconvert. To get this to work, iplot would have to also display a static image format of the plot. It would be as simply as a call to display(Image(raw_image_data)) to include that in the notebook.

We (IPython dev team) is super excited about plotly and are more than willing to answer questions, etc. about the IPython integration.

@jackparmer
Copy link
Contributor

Awesome! Thanks! Nice to e-meet you. We're psyched to meet Fernando + team in Feb. IPython has been an wonderful way for communicating / teaching API tidbits to users, plus a lot of fun!

We're looking into adding image conversion to Plotly's API, so one could swap out the interactive iframe for a static image (svg, pdf, png, or eps), then they could use nbconvert. We would love to be able to export our notebooks with plotly graphs into pdf or latex - We'll certainly be in touch if we have questions or make headway!

@chriddyp
Copy link
Member

Thanks so much for the suggestion! We finally got around to this, fixed in #107

$ ipython nbconvert mynotebook.ipynb --to latex --post PDF

Here is the notebook: http://nbviewer.ipython.org/gist/chriddyp/32a4ed87825346cb233c
And here is the resulting PDF: https://drive.google.com/file/d/0B8yfcydpsVhhZDFtd1l0Z2pIeXM/edit?usp=sharing

@calumroy
Copy link

I seem to be having problems with this. Your example didn't work for me the pdf showed
<plotly.tools.PlotlyDisplay object> instead of the plot in the output pdf.

I am running OSX el captain 10.11.2.
I ran the command with the option --to pdf as the option --to latex --post PDF didn't work it returned No module named PDF.

ipython nbconvert test_to_pdf.ipynb --to pdf
[NbConvertApp] Converting notebook test_to_pdf.ipynb to pdf
[NbConvertApp] Writing 19096 bytes to notebook.tex
[NbConvertApp] Building PDF
[NbConvertApp] Running pdflatex 3 times: [u'pdflatex', u'notebook.tex']
[NbConvertApp] PDF successfully created
[NbConvertApp] Writing 46214 bytes to test_to_pdf.pdf

@FayeL37
Copy link

FayeL37 commented Oct 3, 2017

It seems the PDF version doesn't show the plotly graph. @chriddyp

@FayeL37
Copy link

FayeL37 commented Oct 3, 2017

When I type display(Image(raw_image_data)) into Jupyter Notebook, there is an error rising and saying Image is not defined. Any suggestion? Thanks @ellisonbg

chriddyp added a commit that referenced this issue Mar 5, 2018
we’ll end up adding a lot of this stuff back at the end. for now, let’s
just only test python 35
nicolaskruchten pushed a commit that referenced this issue Nov 23, 2021
Adding setup details for mapbox token to help with #3483
alexcjohnson pushed a commit that referenced this issue Jun 8, 2023
Update _streamline.py to avoid np.matrix
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

5 participants