File tree Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change 55 text_representation :
66 extension : .md
77 format_name : markdown
8- format_version : ' 1.1 '
9- jupytext_version : 1.1.6
8+ format_version : ' 1.2 '
9+ jupytext_version : 1.3.0
1010 kernelspec :
1111 display_name : Python 3
1212 language : python
@@ -138,6 +138,29 @@ fig.add_trace(go.Scatter(
138138fig.show()
139139```
140140
141+ #### Legend titles
142+
143+ ``` python
144+ import plotly.graph_objects as go
145+
146+ fig = go.Figure()
147+
148+ fig.add_trace(go.Scatter(
149+ x = [1 , 2 , 3 , 4 , 5 ],
150+ y = [1 , 2 , 3 , 4 , 5 ],
151+ name = " Increasing"
152+ ))
153+
154+ fig.add_trace(go.Scatter(
155+ x = [1 , 2 , 3 , 4 , 5 ],
156+ y = [5 , 4 , 3 , 2 , 1 ],
157+ name = " Decreasing"
158+ ))
159+
160+ fig.update_layout(legend_title = ' <b> Trend </b>' )
161+ fig.show()
162+ ```
163+
141164#### Horizontal Legend
142165
143166``` python
@@ -200,7 +223,7 @@ fig.add_trace(go.Scatter(
200223))
201224
202225fig.update_layout(
203- legend = go.layout.Legend (
226+ legend = dict (
204227 x = 0 ,
205228 y = 1 ,
206229 traceorder = " normal" ,
You can’t perform that action at this time.
0 commit comments