Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc8bb7f0

Browse files
authored
Merge pull request#182 from plotly/title_alignment_py
title alignment
2 parentsfe5e886 +6d1f80d commitc8bb7f0

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

‎python/figure-labels.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension:.md
77
format_name:markdown
88
format_version:'1.1'
9-
jupytext_version:1.1.1
9+
jupytext_version:1.2.1
1010
kernelspec:
1111
display_name:Python 3
1212
language:python
@@ -20,7 +20,7 @@ jupyter:
2020
name:python
2121
nbconvert_exporter:python
2222
pygments_lexer:ipython3
23-
version:3.6.8
23+
version:3.7.3
2424
plotly:
2525
description:How to set the global font, title, legend-entries, and axis-titles
2626
in python.
@@ -66,5 +66,26 @@ fig.update_layout(
6666
fig.show()
6767
```
6868

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+
6990
####Reference
7091
Seehttps://plot.ly/python/reference/#layout for more information!

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp