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

Skip to content

Commit a0dad3c

Browse files
committed
Merge pull request plotly#173 from plotly/fix_stream_docstring
make docstream copy pasteable; fix parentheses
2 parents d9b7cdc + c57737c commit a0dad3c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

plotly/plotly/plotly.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,15 @@ class Stream:
406406
Stream example:
407407
# Initialize a streaming graph
408408
# by embedding stream_id's in the graph's traces
409-
>>> stream_id = "your_stream_id" # See {plotly_domain}/settings
410-
>>> py.plot(Data([Scatter(x=[],
411-
y=[],
412-
stream=dict(token=stream_id, maxpoints=100))])
409+
import plotly.plotly as py
410+
from plotly.graph_objs import Data, Scatter, Stream
411+
stream_id = "your_stream_id" # See {plotly_domain}/settings
412+
py.plot(Data([Scatter(x=[], y=[],
413+
stream=Stream(token=stream_id, maxpoints=100))]))
413414
# Stream data to the import trace
414-
>>> stream = Stream(stream_id) # Initialize a stream object
415-
>>> stream.open() # Open the stream
416-
>>> stream.write(dict(x=1, y=1)) # Plot (1, 1) in your graph
415+
stream = Stream(stream_id) # Initialize a stream object
416+
stream.open() # Open the stream
417+
stream.write(dict(x=1, y=1)) # Plot (1, 1) in your graph
417418
"""
418419

419420
@utils.template_doc(**tools.get_config_file())

0 commit comments

Comments
 (0)