From c57737c5458b358b76134f22d15b53f7cb8f4be7 Mon Sep 17 00:00:00 2001 From: Chris P Date: Wed, 7 Jan 2015 13:17:28 -0500 Subject: [PATCH] make docstream copy pasteable; fix parentheses --- plotly/plotly/plotly.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plotly/plotly/plotly.py b/plotly/plotly/plotly.py index 432a4888074..e3ba3fa4292 100644 --- a/plotly/plotly/plotly.py +++ b/plotly/plotly/plotly.py @@ -406,14 +406,15 @@ class Stream: Stream example: # Initialize a streaming graph # by embedding stream_id's in the graph's traces - >>> stream_id = "your_stream_id" # See {plotly_domain}/settings - >>> py.plot(Data([Scatter(x=[], - y=[], - stream=dict(token=stream_id, maxpoints=100))]) + import plotly.plotly as py + from plotly.graph_objs import Data, Scatter, Stream + stream_id = "your_stream_id" # See {plotly_domain}/settings + py.plot(Data([Scatter(x=[], y=[], + stream=Stream(token=stream_id, maxpoints=100))])) # Stream data to the import trace - >>> stream = Stream(stream_id) # Initialize a stream object - >>> stream.open() # Open the stream - >>> stream.write(dict(x=1, y=1)) # Plot (1, 1) in your graph + stream = Stream(stream_id) # Initialize a stream object + stream.open() # Open the stream + stream.write(dict(x=1, y=1)) # Plot (1, 1) in your graph """ @utils.template_doc(**tools.get_config_file())