Skip to content

Commit 062d43c

Browse files
committed
update example
1 parent ca84936 commit 062d43c

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

doc/python/v6-changes.md

+6-26
Original file line numberDiff line numberDiff line change
@@ -69,32 +69,7 @@ The following attributes have been removed in Plotly.py 6.
6969

7070
The `titlefont`,`titleposition`, `titleside`, and `titleoffset` attributes have been removed. Replace them with `title.font`, `title.position`, `title.side`, and `title.offset`.
7171

72-
Here's an example using `layout.titlefont`:
73-
74-
```python
75-
import plotly.graph_objects as go
76-
77-
trace = go.Bar(
78-
x=['A', 'B', 'C', 'D'],
79-
y=[10, 15, 13, 17]
80-
)
81-
82-
layout = go.Layout(
83-
title=dict(
84-
text='Chart Title'
85-
),
86-
titlefont=dict(
87-
size=40
88-
)
89-
)
90-
91-
fig = go.Figure(data=[trace], layout=layout)
92-
93-
fig.show()
94-
```
95-
96-
Updated to use `layout.title.font`:
97-
72+
The following example shows how to use `layout.title.font`:
9873

9974
```python
10075
import plotly.graph_objects as go
@@ -111,6 +86,11 @@ layout = go.Layout(
11186
)
11287
)
11388

89+
# Previously this could be written as
90+
# titlefont=dict(
91+
# size=40
92+
# )
93+
11494
fig = go.Figure(data=[trace], layout=layout)
11595

11696
fig.show()

0 commit comments

Comments
 (0)