I need to include this graph https://plot.ly/~ekirzhner/6/ into my Jupiter Notebook. How to proceed? Thanks
-
Do you want it to be an interactive graph? Or do you just want to load a png or jpeg image of the graph into jupyter notebook?Dave Rosenman– Dave Rosenman2017-12-08 23:57:05 +00:00Commented Dec 8, 2017 at 23:57
-
@David Rosenman Interactive html graphLena Kir– Lena Kir2017-12-08 23:58:49 +00:00Commented Dec 8, 2017 at 23:58
Add a comment
|
1 Answer
Click on "share" at the bottom right of the image. If you embed it as an iframe, use a code cell. You'll get an interactive graph if you copy and paste this code into the cell.
import IPython
iframe = '<iframe width="900" height="800" frameborder="0" scrolling="no" src="//plot.ly/~ekirzhner/6.embed"></iframe>'
IPython.display.HTML(iframe)
To import a static graph using html, in a markdown cell, use the following code:
%%html
<div>
<a href="https://plot.ly/~ekirzhner/6/" target="_blank" title="Plot 6" style="display: block; text-align: center;"><img src="https://plot.ly/~ekirzhner/6.png" alt="Plot 6" style="max-width: 100%;width: 600px;" width="600" onerror="this.onerror=null;this.src='https://plot.ly/404.png';" /></a>
I created a notebook file that contains a static graph from the html option plus a cell with the interactive plotly graph that you can download here