File tree 1 file changed +26
-3
lines changed
1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change 5
5
text_representation :
6
6
extension : .md
7
7
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
10
10
kernelspec :
11
11
display_name : Python 3
12
12
language : python
@@ -138,6 +138,29 @@ fig.add_trace(go.Scatter(
138
138
fig.show()
139
139
```
140
140
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
+
141
164
#### Horizontal Legend
142
165
143
166
``` python
@@ -200,7 +223,7 @@ fig.add_trace(go.Scatter(
200
223
))
201
224
202
225
fig.update_layout(
203
- legend = go.layout.Legend (
226
+ legend = dict (
204
227
x = 0 ,
205
228
y = 1 ,
206
229
traceorder = " normal" ,
You can’t perform that action at this time.
0 commit comments