File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -74,25 +74,25 @@ The following example shows how to use `layout.title.font`:
74
74
``` python
75
75
import plotly.graph_objects as go
76
76
77
- trace = go.Bar(
78
- x = [' A' , ' B' , ' C' , ' D' ],
79
- y = [10 , 15 , 13 , 17 ]
77
+ fig = go.Figure(
78
+ data = [
79
+ go.Bar(
80
+ x = [" A" , " B" , " C" , " D" ],
81
+ y = [10 , 15 , 13 , 17 ]
82
+ )
83
+ ],
84
+ layout = dict (
85
+ title = dict (
86
+ text = " Chart Title" ,
87
+ font = dict (
88
+ size = 40
89
+ )
90
+ )
91
+ ),
92
+ # Previously the title font could be set like this:
93
+ # titlefont=dict(size=40)
80
94
)
81
95
82
- layout = go.Layout(
83
- title = dict (
84
- text = ' Chart Title' ,
85
- font = dict (size = 40 )
86
- )
87
- )
88
-
89
- # Previously this could be written as
90
- # titlefont=dict(
91
- # size=40
92
- # )
93
-
94
- fig = go.Figure(data = [trace], layout = layout)
95
-
96
96
fig.show()
97
97
```
98
98
You can’t perform that action at this time.
0 commit comments