-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplotly.basedatatypes.BaseFigure.html
More file actions
293 lines (261 loc) · 21.8 KB
/
plotly.basedatatypes.BaseFigure.html
File metadata and controls
293 lines (261 loc) · 21.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>plotly.basedatatypes.BaseFigure — 4.6.0 documentation</title>
<link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/plotly-style.css" />
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/language_data.js"></script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="../_static/js/jquery-1.11.0.min.js "></script>
<script type="text/javascript" src="../_static/js/jquery-fix.js "></script>
<script type="text/javascript" src="../_static/bootstrap-3.3.7/js/bootstrap.min.js "></script>
<script type="text/javascript" src="../_static/bootstrap-sphinx.js "></script>
</head><body>
<div id="navbar" class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html"><span><img src="../_static/logo.png"></span>
</a>
<span class="navbar-text navbar-version pull-left"><b></b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li class="dropdown globaltoc-container">
<a role="button"
id="dLabelGlobalToc"
data-toggle="dropdown"
data-target="#"
href="../index.html">Site <b class="caret"></b></a>
<ul class="dropdown-menu globaltoc"
role="menu"
aria-labelledby="dLabelGlobalToc"><ul>
<li class="toctree-l1"><a class="reference internal" href="../plotly.express.html"><code class="docutils literal notranslate"><span class="pre">plotly.express</span></code>: high-level interface for data visualization</a></li>
<li class="toctree-l1"><a class="reference internal" href="../plotly.graph_objects.html"><code class="docutils literal notranslate"><span class="pre">plotly.graph_objects</span></code>: low-level interface to figures, traces and layout</a></li>
<li class="toctree-l1"><a class="reference internal" href="../plotly.subplots.html"><code class="docutils literal notranslate"><span class="pre">plotly.subplots</span></code>: helper function for laying out multi-plot figures</a></li>
<li class="toctree-l1"><a class="reference internal" href="../plotly.figure_factory.html"><code class="docutils literal notranslate"><span class="pre">plotly.figure_factory</span></code>: helper methods for building specific complex charts</a></li>
<li class="toctree-l1"><a class="reference internal" href="../plotly.io.html"><code class="docutils literal notranslate"><span class="pre">plotly.io</span></code>: low-level interface for displaying, reading and writing figures</a></li>
</ul>
</ul>
</li>
<li class="dropdown">
<a role="button"
id="dLabelLocalToc"
data-toggle="dropdown"
data-target="#"
href="#">Page <b class="caret"></b></a>
<ul class="dropdown-menu localtoc"
role="menu"
aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">plotly.basedatatypes.BaseFigure</a></li>
</ul>
</ul>
</li>
</ul>
<form class="navbar-form navbar-right" action="../search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="body col-md-12 content" role="main">
<div class="section" id="plotly-basedatatypes-basefigure">
<h1>plotly.basedatatypes.BaseFigure<a class="headerlink" href="#plotly-basedatatypes-basefigure" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="plotly.basedatatypes.BaseFigure">
<em class="property">class </em><code class="sig-prename descclassname">plotly.basedatatypes.</code><code class="sig-name descname">BaseFigure</code><span class="sig-paren">(</span><em class="sig-param">data=None</em>, <em class="sig-param">layout_plotly=None</em>, <em class="sig-param">frames=None</em>, <em class="sig-param">skip_invalid=False</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#plotly.basedatatypes.BaseFigure" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for all figure types (both widget and non-widget)</p>
<dl class="method">
<dt id="plotly.basedatatypes.BaseFigure.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param">data=None</em>, <em class="sig-param">layout_plotly=None</em>, <em class="sig-param">frames=None</em>, <em class="sig-param">skip_invalid=False</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#plotly.basedatatypes.BaseFigure.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a BaseFigure object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>data</strong> – <p>One of:
- A list or tuple of trace objects (or dicts that can be coerced
into trace objects)</p>
<ul>
<li><p>If <code class="docutils literal notranslate"><span class="pre">data</span></code> is a dict that contains a ‘data’,</p></li>
</ul>
<p>’layout’, or ‘frames’ key then these values are used to
construct the figure.</p>
<ul>
<li><p>If <code class="docutils literal notranslate"><span class="pre">data</span></code> is a <code class="docutils literal notranslate"><span class="pre">BaseFigure</span></code> instance then the <code class="docutils literal notranslate"><span class="pre">data</span></code>, <code class="docutils literal notranslate"><span class="pre">layout</span></code>,</p></li>
</ul>
<p>and <code class="docutils literal notranslate"><span class="pre">frames</span></code> properties are extracted from the input figure</p>
</p></li>
<li><p><strong>layout_plotly</strong> – <p>The plotly layout dict.</p>
<p>Note: this property is named <code class="docutils literal notranslate"><span class="pre">layout_plotly</span></code> rather than <code class="docutils literal notranslate"><span class="pre">layout</span></code>
to deconflict it with the <code class="docutils literal notranslate"><span class="pre">layout</span></code> constructor parameter of the
<code class="docutils literal notranslate"><span class="pre">widgets.DOMWidget</span></code> ipywidgets class, as the <code class="docutils literal notranslate"><span class="pre">BaseFigureWidget</span></code>
class is a subclass of both BaseFigure and widgets.DOMWidget.</p>
<p>If the <code class="docutils literal notranslate"><span class="pre">data</span></code> property is a BaseFigure instance, or a dict that
contains a ‘layout’ key, then this property is ignored.</p>
</p></li>
<li><p><strong>frames</strong> – <p>A list or tuple of <code class="docutils literal notranslate"><span class="pre">plotly.graph_objects.Frame</span></code> objects (or dicts
that can be coerced into Frame objects)</p>
<p>If the <code class="docutils literal notranslate"><span class="pre">data</span></code> property is a BaseFigure instance, or a dict that
contains a ‘frames’ key, then this property is ignored.</p>
</p></li>
<li><p><strong>skip_invalid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)"><em>bool</em></a>) – If True, invalid properties in the figure specification will be
skipped silently. If False (default) invalid properties in the
figure specification will result in a ValueError</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/exceptions.html#ValueError" title="(in Python v3.8)"><strong>ValueError</strong></a> – if a property in the specification of data, layout, or frames
is invalid AND skip_invalid is False</p>
</dd>
</dl>
</dd></dl>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#plotly.basedatatypes.BaseFigure.__init__" title="plotly.basedatatypes.BaseFigure.__init__"><code class="xref py py-obj docutils literal notranslate"><span class="pre">__init__</span></code></a>([data, layout_plotly, frames, …])</p></td>
<td><p>Construct a BaseFigure object</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.add_trace" title="plotly.basedatatypes.BaseFigure.add_trace"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add_trace</span></code></a>(trace[, row, col, secondary_y])</p></td>
<td><p>Add a trace to the figure</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.add_traces" title="plotly.basedatatypes.BaseFigure.add_traces"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add_traces</span></code></a>(data[, rows, cols, secondary_ys])</p></td>
<td><p>Add traces to the figure</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.append_trace" title="plotly.basedatatypes.BaseFigure.append_trace"><code class="xref py py-obj docutils literal notranslate"><span class="pre">append_trace</span></code></a>(trace, row, col)</p></td>
<td><p>Add a trace to the figure bound to axes at the specified row, col index.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.batch_animate" title="plotly.basedatatypes.BaseFigure.batch_animate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">batch_animate</span></code></a>([duration, easing])</p></td>
<td><p>Context manager to animate trace / layout updates</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.batch_update" title="plotly.basedatatypes.BaseFigure.batch_update"><code class="xref py py-obj docutils literal notranslate"><span class="pre">batch_update</span></code></a>()</p></td>
<td><p>A context manager that batches up trace and layout assignment operations into a singe plotly_update message that is executed when the context exits.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.for_each_trace" title="plotly.basedatatypes.BaseFigure.for_each_trace"><code class="xref py py-obj docutils literal notranslate"><span class="pre">for_each_trace</span></code></a>(fn[, selector, row, col, …])</p></td>
<td><p>Apply a function to all traces that satisfy the specified selection criteria</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.get_subplot" title="plotly.basedatatypes.BaseFigure.get_subplot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_subplot</span></code></a>(row, col[, secondary_y])</p></td>
<td><p>Return an object representing the subplot at the specified row and column.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.plotly_relayout" title="plotly.basedatatypes.BaseFigure.plotly_relayout"><code class="xref py py-obj docutils literal notranslate"><span class="pre">plotly_relayout</span></code></a>(relayout_data, **kwargs)</p></td>
<td><p>Perform a Plotly relayout operation on the figure’s layout</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.plotly_restyle" title="plotly.basedatatypes.BaseFigure.plotly_restyle"><code class="xref py py-obj docutils literal notranslate"><span class="pre">plotly_restyle</span></code></a>(restyle_data[, trace_indexes])</p></td>
<td><p>Perform a Plotly restyle operation on the figure’s traces</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.plotly_update" title="plotly.basedatatypes.BaseFigure.plotly_update"><code class="xref py py-obj docutils literal notranslate"><span class="pre">plotly_update</span></code></a>([restyle_data, relayout_data, …])</p></td>
<td><p>Perform a Plotly update operation on the figure.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.pop" title="plotly.basedatatypes.BaseFigure.pop"><code class="xref py py-obj docutils literal notranslate"><span class="pre">pop</span></code></a>(key, *args)</p></td>
<td><p>Remove the value associated with the specified key and return it</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.print_grid" title="plotly.basedatatypes.BaseFigure.print_grid"><code class="xref py py-obj docutils literal notranslate"><span class="pre">print_grid</span></code></a>()</p></td>
<td><p>Print a visual layout of the figure’s axes arrangement.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.select_traces" title="plotly.basedatatypes.BaseFigure.select_traces"><code class="xref py py-obj docutils literal notranslate"><span class="pre">select_traces</span></code></a>([selector, row, col, secondary_y])</p></td>
<td><p>Select traces from a particular subplot cell and/or traces that satisfy custom selection criteria.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.show" title="plotly.basedatatypes.BaseFigure.show"><code class="xref py py-obj docutils literal notranslate"><span class="pre">show</span></code></a>(*args, **kwargs)</p></td>
<td><p>Show a figure using either the default renderer(s) or the renderer(s) specified by the renderer argument</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.to_dict" title="plotly.basedatatypes.BaseFigure.to_dict"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_dict</span></code></a>()</p></td>
<td><p>Convert figure to a dictionary</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.to_html" title="plotly.basedatatypes.BaseFigure.to_html"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_html</span></code></a>(*args, **kwargs)</p></td>
<td><p>Convert a figure to an HTML string representation.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.to_image" title="plotly.basedatatypes.BaseFigure.to_image"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_image</span></code></a>(*args, **kwargs)</p></td>
<td><p>Convert a figure to a static image bytes string</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.to_json" title="plotly.basedatatypes.BaseFigure.to_json"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_json</span></code></a>(*args, **kwargs)</p></td>
<td><p>Convert a figure to a JSON string representation</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.to_ordered_dict" title="plotly.basedatatypes.BaseFigure.to_ordered_dict"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_ordered_dict</span></code></a>([skip_uid])</p></td>
<td><p></p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.to_plotly_json" title="plotly.basedatatypes.BaseFigure.to_plotly_json"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_plotly_json</span></code></a>()</p></td>
<td><p>Convert figure to a JSON representation as a Python dict</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.update" title="plotly.basedatatypes.BaseFigure.update"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update</span></code></a>([dict1, overwrite])</p></td>
<td><p>Update the properties of the figure with a dict and/or with keyword arguments.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.update_layout" title="plotly.basedatatypes.BaseFigure.update_layout"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_layout</span></code></a>([dict1, overwrite])</p></td>
<td><p>Update the properties of the figure’s layout with a dict and/or with keyword arguments.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.update_traces" title="plotly.basedatatypes.BaseFigure.update_traces"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_traces</span></code></a>([patch, selector, row, col, …])</p></td>
<td><p>Perform a property update operation on all traces that satisfy the specified selection criteria</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.write_html" title="plotly.basedatatypes.BaseFigure.write_html"><code class="xref py py-obj docutils literal notranslate"><span class="pre">write_html</span></code></a>(*args, **kwargs)</p></td>
<td><p>Write a figure to an HTML file representation</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.write_image" title="plotly.basedatatypes.BaseFigure.write_image"><code class="xref py py-obj docutils literal notranslate"><span class="pre">write_image</span></code></a>(*args, **kwargs)</p></td>
<td><p>Convert a figure to a static image and write it to a file or writeable object</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.write_json" title="plotly.basedatatypes.BaseFigure.write_json"><code class="xref py py-obj docutils literal notranslate"><span class="pre">write_json</span></code></a>(*args, **kwargs)</p></td>
<td><p>Convert a figure to JSON and write it to a file or writeable object</p></td>
</tr>
</tbody>
</table>
<p class="rubric">Attributes</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.data" title="plotly.basedatatypes.BaseFigure.data"><code class="xref py py-obj docutils literal notranslate"><span class="pre">data</span></code></a></p></td>
<td><p>The <code class="docutils literal notranslate"><span class="pre">data</span></code> property is a tuple of the figure’s trace objects</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.frames" title="plotly.basedatatypes.BaseFigure.frames"><code class="xref py py-obj docutils literal notranslate"><span class="pre">frames</span></code></a></p></td>
<td><p>The <code class="docutils literal notranslate"><span class="pre">frames</span></code> property is a tuple of the figure’s frame objects</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="plotly.html#plotly.basedatatypes.BaseFigure.layout" title="plotly.basedatatypes.BaseFigure.layout"><code class="xref py py-obj docutils literal notranslate"><span class="pre">layout</span></code></a></p></td>
<td><p>The <code class="docutils literal notranslate"><span class="pre">layout</span></code> property of the figure</p></td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-39373211-1']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>