You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python/figure-labels.md
+23-2Lines changed: 23 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ jupyter:
6
6
extension:.md
7
7
format_name:markdown
8
8
format_version:'1.1'
9
-
jupytext_version:1.1.1
9
+
jupytext_version:1.2.1
10
10
kernelspec:
11
11
display_name:Python 3
12
12
language:python
@@ -20,7 +20,7 @@ jupyter:
20
20
name:python
21
21
nbconvert_exporter:python
22
22
pygments_lexer:ipython3
23
-
version:3.6.8
23
+
version:3.7.3
24
24
plotly:
25
25
description:How to set the global font, title, legend-entries, and axis-titles
26
26
in python.
@@ -66,5 +66,26 @@ fig.update_layout(
66
66
fig.show()
67
67
```
68
68
69
+
###Align Plot Title
70
+
The following example shows how to align the plot title in[layout.title](https://plot.ly/python/reference/#layout-title).`x` sets the x position with respect to`xref` from "0" (left) to "1" (right), and`y` sets the y position with respect to`yref` from "0" (bottom) to "1" (top). Moreover, you can define`xanchor` to`left`,`right`, or`center` for setting the title's horizontal alignment with respect to its x position, and/or`yanchor` to`top`,`bottom`, or`middle` for setting the title's vertical alignment with respect to its y position.
71
+
72
+
```python
73
+
import plotly.graph_objectsas go
74
+
75
+
fig= go.Figure(go.Scatter(
76
+
y=[3,1,4],
77
+
x=["Mon","Tue","Wed"]))
78
+
79
+
fig.update_layout(
80
+
title={
81
+
'text':"Plot Title",
82
+
'y':0.9,
83
+
'x':0.5,
84
+
'xanchor':'center',
85
+
'yanchor':'top'})
86
+
87
+
fig.show()
88
+
```
89
+
69
90
####Reference
70
91
Seehttps://plot.ly/python/reference/#layout for more information!