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

Skip to content

Commit 3840a85

Browse files
committed
describe replacing object in relayout
1 parent a9f98ad commit 3840a85

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

plotly/widgets/graph_widget.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ def relayout(self, layout):
364364
the title of an axis, combine the keys with a period
365365
e.g. `xaxis.title`. To set a value of an element in an array,
366366
like an axis's range, use brackets, e.g. 'xaxis.range[0]'.
367+
To replace an entire nested object, just specify the value to
368+
the sub-object. See example 4 below.
367369
368370
See all of the layout attributes in our reference documentation
369371
https://plot.ly/python/reference/#Layout
@@ -393,6 +395,11 @@ def relayout(self, layout):
393395
```
394396
graph.relayout({'xaxis.range[0]': -3})
395397
```
398+
399+
Example 4 - Replace the entire xaxis object
400+
```
401+
graph.relayout({'xaxis': {'title': 'Experimental results'}})
402+
```
396403
"""
397404
# TODO: Add flat layout to graph_objs
398405
message = {

0 commit comments

Comments
 (0)