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

Skip to content

Commit 38b40fd

Browse files
committed
name indices argument in examples
1 parent 99faf0c commit 38b40fd

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

plotly/widgets/graph_widget.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -719,20 +719,22 @@ def extend_traces(self, update, indices=(0,), max_points=None):
719719
720720
Example 1 - Extend the first trace with x and y data
721721
```
722-
graph.extend_traces({'x': [[1,2,3]], 'y': [[10,20,30]]}, [0])
722+
graph.extend_traces({'x': [[1, 2, 3]], 'y': [[10, 20, 30]]},
723+
indices=[0])
723724
```
724725
725726
Example 2 - Extend the second trace with x and y data
726727
```
727-
graph.extend_traces({'x': [[1,2,3]], 'y': [[10,20,30]]}, [1])
728+
graph.extend_traces({'x': [[1, 2, 3]], 'y': [[10, 20, 30]]},
729+
indices=[1])
728730
```
729731
730732
Example 3 - Extend the first two traces with x and y data
731733
```
732734
graph.extend_traces({
733-
'x': [[1,2,3], [2,3,4]],
734-
'y': [[10,20,30], [3,4,3]]
735-
}, [0, 1])
735+
'x': [[1, 2, 3], [2, 3, 4]],
736+
'y': [[10, 20, 30], [3, 4, 3]]
737+
}, indices=[0, 1])
736738
```
737739
738740
Example 4 - Extend the first trace with x and y data and
@@ -743,7 +745,7 @@ def extend_traces(self, update, indices=(0,), max_points=None):
743745
graph.extend_traces({
744746
'x': [range(100)],
745747
'y': [range(100)]
746-
}, [0, 1], max_points=50)
748+
}, indices=[0, 1], max_points=50)
747749
```
748750
749751
Example 5 - Extend the first and second trace with x and y data
@@ -755,6 +757,7 @@ def extend_traces(self, update, indices=(0,), max_points=None):
755757
'x': [new_points, new_points],
756758
'y': [new_points, new_points]
757759
},
760+
indices=[0, 1],
758761
[0, 1],
759762
max_points={
760763
'x': [25, 50],

0 commit comments

Comments
 (0)