MCPcopy Index your code
hub / github.com/plotly/plotly.py / update

Method update

plotly/graph_objs/_figure.py:74–123  ·  view source on GitHub ↗

Update the properties of the figure with a dict and/or with keyword arguments. This recursively updates the structure of the figure object with the values in the input dict / keyword arguments. Parameters ---------- dict1 : dict

(self, dict1=None, overwrite=False, **kwargs)

Source from the content-addressed store, hash-verified

72 super().__init__(data, layout, frames, skip_invalid, **kwargs)
73
74 def update(self, dict1=None, overwrite=False, **kwargs) -> "Figure":
75 """
76
77 Update the properties of the figure with a dict and/or with
78 keyword arguments.
79
80 This recursively updates the structure of the figure
81 object with the values in the input dict / keyword arguments.
82
83 Parameters
84 ----------
85 dict1 : dict
86 Dictionary of properties to be updated
87 overwrite: bool
88 If True, overwrite existing properties. If False, apply updates
89 to existing properties recursively, preserving existing
90 properties that are not specified in the update operation.
91 kwargs :
92 Keyword/value pair of properties to be updated
93
94 Examples
95 --------
96 >>> import plotly.graph_objs as go
97 >>> fig = go.Figure(data=[{'y': [1, 2, 3]}])
98 >>> fig.update(data=[{'y': [4, 5, 6]}]) # doctest: +ELLIPSIS
99 Figure(...)
100 >>> fig.to_plotly_json() # doctest: +SKIP
101 {'data': [{'type': 'scatter',
102 'uid': 'e86a7c7a-346a-11e8-8aa8-a0999b0c017b',
103 'y': array([4, 5, 6], dtype=int32)}],
104 'layout': {}}
105
106 >>> fig = go.Figure(layout={'xaxis':
107 ... {'color': 'green',
108 ... 'range': [0, 1]}})
109 >>> fig.update({'layout': {'xaxis': {'color': 'pink'}}}) # doctest: +ELLIPSIS
110 Figure(...)
111 >>> fig.to_plotly_json() # doctest: +SKIP
112 {'data': [],
113 'layout': {'xaxis':
114 {'color': 'pink',
115 'range': [0, 1]}}}
116
117 Returns
118 -------
119 BaseFigure
120 Updated figure
121
122 """
123 return super().update(dict1, overwrite, **kwargs)
124
125 def update_traces(
126 self,

Callers 15

test_update_dictMethod · 0.95
test_bug_1462Method · 0.95
update_coloraxesMethod · 0.45
update_geosMethod · 0.45
update_legendsMethod · 0.45
update_mapsMethod · 0.45

Calls

no outgoing calls

Tested by 8

test_update_dictMethod · 0.76
test_bug_1462Method · 0.76