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
Copy file name to clipboardExpand all lines: notebooks/creating-updating-figures.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -31,16 +31,18 @@ jupyter:
31
31
##Figures as dictionaries
32
32
The goal of plotly.py is to provide a pleasant Python interface for creating figure specifications for display in the Plotly.js JavaScript library. In Plotly.js, a figure is specified by a declarative JSON data structure, and so the ultimate responsibility of plotly.py is to produce Python dictionaries that can be serialized into a JSON data structure that represents a valid figure.
33
33
34
-
As a concrete example, here isthe Python dictionary that represents a figure containing a single bar trace and a title.
34
+
As a concrete example, here isa Python dictionary that represents a figure containing a single bar trace and a title.
35
35
36
36
```python
37
-
import plotly.ioas pio
38
37
fig= {
39
38
"data": [{"type":"bar",
40
39
"x": [1,2,3],
41
40
"y": [1,3,2]}],
42
41
"layout": {"title": {"text":"A Bar Chart"}}
43
42
}
43
+
44
+
# To display the figure defined by this dict, use the low-level plotly.io.show function