Skip to content

Commit 79b212a

Browse files
committed
update example
1 parent 062d43c commit 79b212a

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

doc/python/v6-changes.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,25 @@ The following example shows how to use `layout.title.font`:
7474
```python
7575
import plotly.graph_objects as go
7676

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)
8094
)
8195

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-
9696
fig.show()
9797
```
9898

0 commit comments

Comments
 (0)