-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
2019-07-03-embedding-charts.html
65 lines (46 loc) · 2.15 KB
/
2019-07-03-embedding-charts.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
description: How to embed plotly graphs with an iframe in HTML.
display_as: chart_studio
language: python
layout: base
name: Embedding Graphs in HTML
order: 5
permalink: python/embedding-plotly-graphs-in-HTML/
thumbnail: thumbnail/embed.jpg
v4upgrade: True
---
{% raw %}
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.2/require.js"></script>
<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<p>Plotly graphs can be embedded in any HTML page. This includes <a href="https://plotly.com/ipython-notebooks/">IPython notebooks</a>, <a href="https://wordpress.org/plugins/wp-plotly">Wordpress sites</a>, dashboards, blogs, and more.</p>
<p>For more on embedding Plotly graphs in HTML documents, <a href="https://plotly.com/python/interactive-html-export/">see our tutorial</a>.</p>
<p>From Python, you can generate the HTML code to embed Plotly graphs with the <code>plotly.tools.get_embed</code> function.</p>
</div>
</div>
</div>
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In [1]:</div>
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="kn">import</span> <span class="nn">chart_studio.tools</span> <span class="k">as</span> <span class="nn">tls</span>
<span class="n">tls</span><span class="o">.</span><span class="n">get_embed</span><span class="p">(</span><span class="s1">'https://plotly.com/~chris/1638'</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<div class="output_wrapper">
<div class="output">
<div class="output_area">
<div class="prompt output_prompt">Out[1]:</div>
<div class="output_text output_subarea output_execute_result">
<pre>'<iframe id="igraph" scrolling="no" style="border:none;" seamless="seamless" src="https://plotly.com/~chris/1638.embed" height="525" width="100%"></iframe>'</pre>
</div>
</div>
</div>
</div>
</div>
{% endraw %}