Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19b4f21

Browse files
committed
Merge branch 'source' into new-design-2016
# Conflicts: # _includes/documentation_eg.html # _includes/head.html # _includes/lang-splash-banner.html # _includes/side-bar.html # _layouts/base.html # _layouts/langindex.html # _posts/ggplot2/Aesthetics/2016-01-27-aes_index.html # _posts/ggplot2/Faceting/facet_grid/2015-04-09-facets_ggplot2_index.html # _posts/ggplot2/Faceting/facet_wrap/2015-07-14-facet_wrap_index.html # _posts/ggplot2/Theme/axis.text/2016-01-27-Themes_axistext_index.html # _posts/ggplot2/Theme/axis.ticks/2016-01-27-Themes_axisticks_index.html # _posts/ggplot2/Theme/axis.title/2016-01-27-Themes_axistitles_index.html # _posts/ggplot2/time-series/2015-07-14-time-series_ggplot2_index.html # _posts/ggplot2/yscale/2015-07-20-log_scale_index.html # _posts/matlab/backgrounds/2016-02-17-backgrounds_matlab_index.html # _posts/matlab/labels/2015-04-15-matlab-setting-title.html # _posts/matlab/quiver-plots/2016-02-28-matlab-quiver-plot-with-points.htm l # _posts/matlab/quiver-plots/2016-02-28-quiver-plot.html # _posts/matlab/quiver-plots/2016-02-28-quiver_matlab_index.html # _posts/matplotlib/backgrounds/2016-02-12-backgrounds_matplotlib_index.ht ml # _posts/matplotlib/box/2016-02-08-box_matplotlib_index.html # _posts/matplotlib/error-bar/2016-02-08-error-bar_matplotlib_index.html # _posts/matplotlib/heatmap/2016-02-08-heatmap_matplotlib_index.html # _posts/matplotlib/labels/2015-04-15-mpl-setting-title-on-subplots.html # _posts/matplotlib/labels/2015-04-15-mpl-setting-title.html # _posts/matplotlib/labels/2016-02-15-labels_matplotlib_index.html # _posts/matplotlib/lines-and-markers/2016-02-08-lines-and-markers_matplot lib_index.html # _posts/matplotlib/quiver-plots/2016-02-22-mpl-quiver-plot-with-points.ht ml # _posts/matplotlib/quiver-plots/2016-02-22-quiver_matplotlib_index.html # _posts/matplotlib/static-image/2016-02-22-static-image_matplotlib_index. md # _posts/matplotlib/subplots/2016-02-11-mpl-subplot-variable-widths.html # _posts/matplotlib/time-series/2016-02-12-mpl-bsaic-time-series.html # _posts/matplotlib/time-series/2016-02-12-time-series_matplotlib_index.ht ml # _posts/plotly_js/continuous-error-bars/2016-02-15-continuous-error-bar_p lotly_js_index.html # _posts/plotly_js/continuous-error-bars/2016-02-15-continuous-variable.ht ml # _posts/plotly_js/continuous-error-bars/2016-02-15-filled-lines.html # _posts/plotly_js/trisurf/2016-02-29-trisurf-basic.html # _posts/plotly_js/trisurf/2016-02-29-trisurf_plotly_js_index.html # _posts/python/continuous-error-bars/2016-02-15-continuous-error-bar_pyth on_index.html # _posts/python/continuous-error-bars/2016-02-15-continuous-variable.html # _posts/python/continuous-error-bars/2016-02-15-filled-lines.html # _posts/user_guide_python/plotly_offline.ipynb
2 parents eeb11de + bd396d3 commit 19b4f21

12 files changed

+3645
-5
lines changed

_includes/documentation_eg.html

100755100644
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
{% endif %}
5757
{% endfor %}
5858

59+
5960
<!-- START OF GGPLOT CUSTOM LAYOUT -->
6061

6162
<!-- Aesthetics -->
@@ -811,6 +812,45 @@
811812

812813
{% else %}
813814

815+
{% if layout_options_ggplot %}
816+
<hr>
817+
<h4 class="example-section-title" id="layout-options">
818+
<a class="no_underline plot-blue" href="#layout-options">Layout Options</a></h4>
819+
<div class="row">
820+
<div class="six columns">
821+
<ul >
822+
{% assign counter=0 %}
823+
{% for page in languagelist %}
824+
{% if page.display_as == "layout_opt" %}
825+
{% if counter == 6 %}</ul></div><div class="six columns"><ul>{% endif %}
826+
<li><a class="no-list-style" href="/{{page.permalink}}">{{page.name}}</a></li>
827+
{% assign counter=counter | plus:1 %}
828+
{% endif %}
829+
{% endfor %}
830+
</ul>
831+
</div>
832+
</div>
833+
834+
<h4 class="example-section-title" id="static-image-export">
835+
<a class="no_underline plot-blue" href="#static-image-export">Image Export & Retrieving Plots</a></h4>
836+
<div class="row">
837+
<div class="six columns">
838+
<ul>
839+
{% assign counter=0 %}
840+
{% for page in languagelist %}
841+
{% if page.display_as == "get_request" %}
842+
{% if counter == 4 %}</ul></div><div class="six columns"><ul>{% endif %}
843+
<li><a class="no-list-style" href="/{{page.permalink}}">{{page.name}}</a></li>
844+
{% assign counter=counter | plus:1 %}
845+
{% endif %}
846+
{% endfor %}
847+
</ul>
848+
</div>
849+
</div>
850+
{% endif %}
851+
852+
{% else %}
853+
814854
{% if layout_options %}
815855

816856
<section class="--tutorial-section no-image" id="layout-options">

_includes/head.html

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@
4444
crossorigin="anonymous"></script>
4545

4646

47-
</head>
47+
</head>

_includes/lang-splash-banner.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ <h2 class="special-header">
3131
Learn more about <a href="https://plot.ly/javascript/open-source-announcement">why we've open
3232
sourced</a>
3333
</p>
34-
3534
{% else %}
3635
<p>Plotly for {{ page.language | capitalize }} is now entirely open source, free, and self-hosted</p>
3736
<p>

_includes/side-bar.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
{% assign pages_list = site.posts | where:"language", language %}
2626

2727
{% for page in pages_list %}
28-
2928
{% if page.display_as == "chart_type" or page.display_as == "basic" %}
3029
{% assign basic = true %}
3130
{% elsif page.display_as == "advanced_charts"%}

_layouts/base.html

100755100644
File mode changed.

_layouts/langindex.html

100755100644
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040

4141
</main>
4242

43-
44-
4543
{% include helpbox.html %}
4644

4745
{% include _new/_page-components/_footer-main.html %}

_posts/2015-05-25-ipython-notebooks_gallery.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
<p>
1818
Instructions on how to install IPython can be found <a class="no_underline plot-blue" href="http://ipython.org/install.html">here</a>.
1919
</p>
20+
<br>
21+
<p>
22+
Instructions on how to install IPython can be found <a class="no_underline plot-blue" href="http://ipython.org/install.html">here</a>.
23+
</p>
2024

2125
<section>
2226

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
permalink: python/bar_chart_stream/
3+
description: Getting Started with Plotly Streaming
4+
title: Bar Chart Streaming Demo
5+
has_thumbnail: true
6+
thumbnail:
7+
has_thumbnail: false
8+
layout: user-guide
9+
page_type: u-guide
10+
language: python
11+
title: Bar Chart Streaming
12+
---
13+
{% raw %}
14+
<div class="cell border-box-sizing text_cell rendered">
15+
<div class="prompt input_prompt">
16+
</div>
17+
<div class="inner_cell">
18+
<div class="text_cell_render border-box-sizing rendered_html">
19+
<h2 id="Streaming-Bar-Chart-Demo">Streaming Bar Chart Demo<a class="anchor-link" href="#Streaming-Bar-Chart-Demo">&#182;</a></h2>
20+
</div>
21+
</div>
22+
</div>
23+
<div class="cell border-box-sizing code_cell rendered">
24+
<div class="input">
25+
<div class="prompt input_prompt">In&nbsp;[1]:</div>
26+
<div class="inner_cell">
27+
<div class="input_area">
28+
<div class=" highlight hl-ipython2"><pre><span class="kn">import</span> <span class="nn">plotly.plotly</span> <span class="kn">as</span> <span class="nn">py</span>
29+
<span class="kn">import</span> <span class="nn">plotly.tools</span> <span class="kn">as</span> <span class="nn">tls</span>
30+
<span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
31+
<span class="kn">import</span> <span class="nn">time</span>
32+
33+
<span class="kn">from</span> <span class="nn">plotly.graph_objs</span> <span class="kn">import</span> <span class="o">*</span>
34+
35+
<span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
36+
37+
<span class="n">stream_id</span> <span class="o">=</span> <span class="s">&#39;jkc6d90yfw&#39;</span>
38+
39+
<span class="c"># We can generate a new stream id object</span>
40+
<span class="n">stream</span> <span class="o">=</span> <span class="n">Stream</span><span class="p">(</span>
41+
<span class="n">token</span><span class="o">=</span><span class="n">stream_id</span><span class="p">,</span>
42+
<span class="n">maxpoints</span><span class="o">=</span><span class="mi">80</span>
43+
<span class="p">)</span>
44+
</pre></div>
45+
46+
</div>
47+
</div>
48+
</div>
49+
50+
</div>
51+
<div class="cell border-box-sizing code_cell rendered">
52+
<div class="input">
53+
<div class="prompt input_prompt">In&nbsp;[2]:</div>
54+
<div class="inner_cell">
55+
<div class="input_area">
56+
<div class=" highlight hl-ipython2"><pre><span class="c">#A simple bar chart object is generated</span>
57+
58+
<span class="n">trace1</span> <span class="o">=</span> <span class="n">Bar</span><span class="p">(</span>
59+
<span class="n">x</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;one&#39;</span><span class="p">,</span><span class="s">&#39;two&#39;</span><span class="p">,</span><span class="s">&#39;three&#39;</span><span class="p">,</span><span class="s">&#39;four&#39;</span><span class="p">,</span><span class="s">&#39;five&#39;</span><span class="p">],</span>
60+
<span class="n">y</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mi">20</span><span class="p">,</span><span class="mi">20</span><span class="p">,</span><span class="mi">20</span><span class="p">,</span><span class="mi">20</span><span class="p">,</span><span class="mi">20</span><span class="p">]),</span>
61+
<span class="n">stream</span><span class="o">=</span><span class="n">stream</span> <span class="c">#we set the stream parameter to the stream id object created earlier </span>
62+
<span class="p">)</span>
63+
64+
<span class="n">data</span> <span class="o">=</span> <span class="n">Data</span><span class="p">([</span><span class="n">trace1</span><span class="p">])</span>
65+
<span class="n">layout</span> <span class="o">=</span> <span class="n">Layout</span><span class="p">(</span><span class="n">title</span><span class="o">=</span><span class="s">&#39;Bar Chart Streaming&#39;</span><span class="p">)</span>
66+
<span class="n">fig</span> <span class="o">=</span> <span class="n">Figure</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span> <span class="n">layout</span><span class="o">=</span><span class="n">layout</span><span class="p">)</span>
67+
</pre></div>
68+
69+
</div>
70+
</div>
71+
</div>
72+
73+
</div>
74+
<div class="cell border-box-sizing code_cell rendered">
75+
<div class="input">
76+
<div class="prompt input_prompt">In&nbsp;[&nbsp;]:</div>
77+
<div class="inner_cell">
78+
<div class="input_area">
79+
<div class=" highlight hl-ipython2"><pre><span class="n">py</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">fig</span><span class="p">,</span> <span class="n">filename</span><span class="o">=</span><span class="s">&#39;bar-chart&#39;</span><span class="p">)</span> <span class="c">#post this plot up onto the plotly servers</span>
80+
</pre></div>
81+
82+
</div>
83+
</div>
84+
</div>
85+
86+
</div>
87+
<div class="cell border-box-sizing code_cell rendered">
88+
<div class="input">
89+
<div class="prompt input_prompt">In&nbsp;[13]:</div>
90+
<div class="inner_cell">
91+
<div class="input_area">
92+
<div class=" highlight hl-ipython2"><pre><span class="c">#Now a Stream object is created w/ the same stream_id as the stream id object</span>
93+
94+
<span class="n">s</span> <span class="o">=</span> <span class="n">py</span><span class="o">.</span><span class="n">Stream</span><span class="p">(</span><span class="n">stream_id</span><span class="p">)</span>
95+
<span class="n">s</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
96+
</pre></div>
97+
98+
</div>
99+
</div>
100+
</div>
101+
102+
</div>
103+
<div class="cell border-box-sizing code_cell rendered">
104+
<div class="input">
105+
<div class="prompt input_prompt">In&nbsp;[&nbsp;]:</div>
106+
<div class="inner_cell">
107+
<div class="input_area">
108+
<div class=" highlight hl-ipython2"><pre><span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
109+
110+
<span class="n">s</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="nb">dict</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="p">[</span><span class="s">&#39;one&#39;</span><span class="p">,</span><span class="s">&#39;two&#39;</span><span class="p">,</span><span class="s">&#39;three&#39;</span><span class="p">,</span><span class="s">&#39;four&#39;</span><span class="p">,</span><span class="s">&#39;five&#39;</span><span class="p">],</span> <span class="n">y</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">random_integers</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">100</span><span class="p">,</span><span class="mi">5</span><span class="p">)))</span>
111+
112+
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mf">0.2</span><span class="p">)</span> <span class="c">#wait one second before plotting again</span>
113+
114+
<span class="n">s</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> <span class="c">#close the stream</span>
115+
</pre></div>
116+
117+
</div>
118+
</div>
119+
</div>
120+
121+
</div>
122+
<div class="cell border-box-sizing code_cell rendered">
123+
<div class="input">
124+
<div class="prompt input_prompt">In&nbsp;[6]:</div>
125+
<div class="inner_cell">
126+
<div class="input_area">
127+
<div class=" highlight hl-ipython2"><pre><span class="n">tls</span><span class="o">.</span><span class="n">embed</span><span class="p">(</span><span class="s">&#39;https://plot.ly/~streaming-demos/116/bar-chart-streaming&#39;</span><span class="p">)</span>
128+
</pre></div>
129+
130+
</div>
131+
</div>
132+
</div>
133+
134+
<div class="output_wrapper">
135+
<div class="output">
136+
137+
138+
<div class="output_area"><div class="prompt output_prompt">Out[6]:</div>
139+
140+
<div class="output_html rendered_html output_subarea output_execute_result">
141+
<iframe id="igraph" scrolling="no" style="border:none;" seamless="seamless" src="https://plot.ly/~streaming-demos/116.embed" height="525" width="100%"></iframe>
142+
</div>
143+
144+
</div>
145+
146+
</div>
147+
</div>
148+
149+
</div>
150+
<div class="cell border-box-sizing text_cell rendered">
151+
<div class="prompt input_prompt">
152+
</div>
153+
<div class="inner_cell">
154+
<div class="text_cell_render border-box-sizing rendered_html">
155+
<div style="float:right; \">
156+
<img src="http://i.imgur.com/4vwuxdJ.png"
157+
align=right style="float:right; margin-left: 5px; margin-top: -10px" />
158+
</div>
159+
160+
<h4>Got Questions or Feedback? </h4>
161+
162+
<p>Reach us here at: <a href="https://community.plot.ly" target="_blank">Plotly Community</a></p>
163+
<p><h4> What's going on at Plotly? </h4>
164+
Check out our twitter:
165+
<a href="https://twitter.com/plotlygraphs" target="_blank">@plotlygraphs</a></p>
166+
167+
</div>
168+
</div>
169+
</div>{% endraw %}

0 commit comments

Comments
 (0)