matplotlib.axes.Axes.set_ylabel#

Axes.set_ylabel(ylabel, fontdict=None, labelpad=None, *, loc=None, **kwargs)[source]#

Set the label for the y-axis.

Parameters:
ylabelstr

The label text.

labelpadfloat, default: rcParams["axes.labelpad"] (default: 4.0)

Spacing in points from the Axes bounding box including ticks and tick labels. If None, the previous value is left as is.

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

The label position. This is a high-level alternative for passing parameters y and horizontalalignment.

Other Parameters:
**kwargsText properties

Text properties control the appearance of the label.

See also

text

Documents the properties supported by Text.

Examples using matplotlib.axes.Axes.set_ylabel#

Bar chart with individual bar colors

Bar chart with individual bar colors

Grouped bar chart with labels

Grouped bar chart with labels

Cross spectral density (CSD)

Cross spectral density (CSD)

fill_between with transparency

fill_between with transparency

Hat graph

Hat graph

Mapping marker properties to multivariate data

Mapping marker properties to multivariate data

Power spectral density (PSD)

Power spectral density (PSD)

Scatter Demo2

Scatter Demo2

Stackplots and streamgraphs

Stackplots and streamgraphs

Contourf demo

Contourf demo

Annotated heatmap

Annotated heatmap

Spectrogram

Spectrogram

Tricontour Demo

Tricontour Demo

Tripcolor Demo

Tripcolor Demo

Triplot Demo

Triplot Demo

Box plots with custom fill colors

Box plots with custom fill colors

Boxplots

Boxplots

Box plot vs. violin plot comparison

Box plot vs. violin plot comparison

Violin plot customization

Violin plot customization

Cumulative distributions

Cumulative distributions

Histogram bins, density, and weight

Histogram bins, density, and weight

Multiple histograms side by side

Multiple histograms side by side

Accented text

Accented text

Align y-labels

Align y-labels

Date tick labels

Date tick labels

Legend Demo

Legend Demo

Mathtext

Mathtext

Multiline

Multiline

Render math equations using TeX

Render math equations using TeX

Text properties

Text properties

Color Demo

Color Demo

Line, Poly and RegularPoly Collection with autoscaling

Line, Poly and RegularPoly Collection with autoscaling

Ellipse Collection

Ellipse Collection

Dark background style sheet

Dark background style sheet

Ticklabel alignment

Ticklabel alignment

Simple axis tick label and tick directions

Simple axis tick label and tick directions

Simple Axisline

Simple Axisline

Anatomy of a figure

Anatomy of a figure

XKCD

XKCD

Pick event demo

Pick event demo

Asinh scale

Asinh scale

Symlog scale

Symlog scale

Topographic hillshading

Topographic hillshading

Artist tutorial

Artist tutorial

Quick start guide

Quick start guide

Choosing Colormaps in Matplotlib

Choosing Colormaps in Matplotlib

Text in Matplotlib

Text in Matplotlib