matplotlib.pyplot.ylabel#

matplotlib.pyplot.ylabel(ylabel, fontdict=None, labelpad=None, *, loc=None, **kwargs)[源代码][源代码]#

设置y轴的标签。

参数:
ylabelstr

标签文本。

labelpad : float, 默认值: rcParams["axes.labelpad"] (default: 4.0)浮点数,默认值:

从包含刻度和刻度标签的轴边界框开始的间距,以点为单位。如果为 None,则保留之前的值。

loc : {'bottom', 'center', 'top'}, 默认值: rcParams["yaxis.labellocation"] (default: 'center'){'bottom', 'center', 'top'}, 默认:

标签位置。这是传递参数 yhorizontalalignment 的高级替代方案。

其他参数:
**kwargs : Text 属性文本属性

Text 属性控制标签的外观。

参见

text

记录 Text 支持的属性。

注释

备注

这是 axes.Axes.set_ylabelpyplot 包装器

使用 matplotlib.pyplot.ylabel 的示例#

多个子图

Multiple subplots

使用字典控制文本和标签的样式

Controlling style of text and labels using a dictionary

Solarized Light 样式表

Solarized Light stylesheet

简单绘图

Simple plot

使用 pyplot 的文本和数学文本

Text and mathtext using pyplot

Findobj 演示

Findobj Demo

表格演示

Table Demo

自定义比例

Custom scale

Pyplot 教程

Pyplot tutorial

快速入门指南

Quick start guide