You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(<codetooltip="{% raw %}{array}{% endraw %} of {% raw %}{object}{% endraw %}s. Each {% raw %}{object}{% endraw %} has one or more of the keys listed below." class="attribute-type">{% raw %}{array}{% endraw %} of {% raw %}{object}{% endraw %}s</code>)
84
75
{% else %}
85
-
{% if page.language != "python" %}
86
-
(<codetooltip="An {% raw %}{object}{% endraw %} with one or more of the keys listed below." class="attribute-type">{% raw %}{object}{% endraw %}</code>)
87
-
{% else %}
88
-
(<codetooltip="A plotly.graph_objs.{{ graph_object }} object with one or more of the keys listed below." class="attribute-type">plotly.graph_objs.{{graph_object}}</code>)
89
-
<br>A <code>plotly.graph_objs.{{ graph_object }}</code> object with any of the named arguments or attributes listed below.
90
-
Import as: <br><code>import plotly.graph_objs as go</code><br><code>go.{{ graph_object }}</code>
91
-
{% endif %}
76
+
(<codetooltip="{% raw %}{object}{% endraw %} with any of the keys listed below." class="attribute-type">{% raw %}{object}{% endraw %}</code>)
<code>plotly</code> charts are described <i>declaratively</i> with objects in <code>plotly.graph_objs</code>. Every aspect of a plotly chart (the colors, the grids, the data, and so on) has a corresponding key-value attribute in these objects. This page contains an extensive list of these attributes.<br><br>
11
+
<code>plotly</code> charts are described <i>declaratively</i> with objects in <code>plotly.graph_objs</code> and <code>dict</code>. Every aspect of a plotly chart (the colors, the grids, the data, and so on) has a corresponding key-value attribute in these objects. This page contains an extensive list of these attributes.<br><br>
12
12
13
13
Plotly's graph description places attributes into two categories: traces (objects that describe a single series of data in a graph like <code>Scatter</code> or <code>Heatmap</code>) and <code>layout</code> attributes that apply to the rest of the chart, like the <code>title</code>, <code>xaxis</code>, or <code>annotations</code>).<br><br>
14
14
15
15
Here is a simple example of a plotly chart inlined with links to each attribute's reference section.
16
16
17
-
<pre>import plotly.graph_objs as go
17
+
<pre>import plotly
18
+
import plotly.plotly as py
19
+
import plotly.graph_objs as go
20
+
21
+
print plotly.__version__ # At least 1.8.6 is required. Upgrade with: $ pip install plotly --upgrade
22
+
18
23
data = [
19
24
go.Scatter( # all "scatter" attributes: <ahref="#scatter">{{ site.BASE_URL }}/python/reference/#scatter</a>
20
25
x=[1, 2, 3], # more about "x": <ahref="#scatter-x">/python/reference/#scatter-x</a>
21
26
y=[3, 1, 6], # more about "y": <ahref="#scatter-y">/python/reference/#scatter-y</a>
22
-
marker=go.Marker( # marker is an object, marker keys: <ahref="#scatter-marker">/python/reference/#scatter-marker</a>
23
-
color="rgb(16, 32, 77)" # more about "marker.color": <ahref="#scatter-marker-color">/python/reference/#scatter-marker-color</a>
27
+
marker=dict( # marker is an dict, marker keys: <ahref="#scatter-marker">/python/reference/#scatter-marker</a>
28
+
color="rgb(16, 32, 77)" # more about marker's "color": <ahref="#scatter-marker-color">/python/reference/#scatter-marker-color</a>
24
29
)
25
30
),
26
31
go.Bar( # all "bar" chart attributes: <ahref="#bar">/python/reference/#bar</a>
0 commit comments