matplotlib.axes.Axes.set_title#

Axes.set_title(label, fontdict=None, loc=None, pad=None, *, y=None, **kwargs)[source]#

Set a title for the Axes.

Set one of the three available Axes titles. The available titles are positioned above the Axes in the center, flush with the left edge, and flush with the right edge.

Parameters:
labelstr

Text to use for the title

fontdictdict

A dictionary controlling the appearance of the title text, the default fontdict is:

{'fontsize': rcParams['axes.titlesize'],
 'fontweight': rcParams['axes.titleweight'],
 'color': rcParams['axes.titlecolor'],
 'verticalalignment': 'baseline',
 'horizontalalignment': loc}
loc{'center', 'left', 'right'}, default: rcParams["axes.titlelocation"] (default: 'center')

Which title to set.

yfloat, default: rcParams["axes.titley"] (default: None)

Vertical Axes location for the title (1.0 is the top). If None (the default) and rcParams["axes.titley"] (default: None) is also None, y is determined automatically to avoid decorators on the Axes.

padfloat, default: rcParams["axes.titlepad"] (default: 6.0)

The offset of the title from the top of the Axes, in points.

Returns:
Text

The matplotlib text instance representing the title

Other Parameters:
**kwargsText properties

Other keyword arguments are text properties, see Text for a list of valid text properties.

Examples using matplotlib.axes.Axes.set_title#

Bar color demo

Bar color demo

Bar color demo
Bar Label Demo

Bar Label Demo

Bar Label Demo
Stacked bar chart

Stacked bar chart

Stacked bar chart
Grouped bar chart with labels

Grouped bar chart with labels

Grouped bar chart with labels
Horizontal bar chart

Horizontal bar chart

Horizontal bar chart
Errorbar subsampling

Errorbar subsampling

Errorbar subsampling
EventCollection Demo

EventCollection Demo

EventCollection Demo
Fill Between and Alpha

Fill Between and Alpha

Fill Between and Alpha
Filling the area between lines

Filling the area between lines

Filling the area between lines
Fill Betweenx Demo

Fill Betweenx Demo

Fill Betweenx Demo
Hat graph

Hat graph

Hat graph
Markevery Demo

Markevery Demo

Markevery Demo
Psd Demo

Psd Demo

Psd Demo
Scatter Demo2

Scatter Demo2

Scatter Demo2
Stackplots and streamgraphs

Stackplots and streamgraphs

Stackplots and streamgraphs
hlines and vlines

hlines and vlines

hlines and vlines
Interactive Adjustment of Colormap Range

Interactive Adjustment of Colormap Range

Interactive Adjustment of Colormap Range
Contour Corner Mask

Contour Corner Mask

Contour Corner Mask
Contour Demo

Contour Demo

Contour Demo
Contour Label Demo

Contour Label Demo

Contour Label Demo
Contourf Demo

Contourf Demo

Contourf Demo
Creating annotated heatmaps

Creating annotated heatmaps

Creating annotated heatmaps
Image antialiasing

Image antialiasing

Image antialiasing
Image Demo

Image Demo

Image Demo
Image Masked

Image Masked

Image Masked
Image Nonuniform

Image Nonuniform

Image Nonuniform
Interpolations for imshow

Interpolations for imshow

Interpolations for imshow
Contour plot of irregularly spaced data

Contour plot of irregularly spaced data

Contour plot of irregularly spaced data
Pcolor Demo

Pcolor Demo

Pcolor Demo
pcolormesh grids and shading

pcolormesh grids and shading

pcolormesh grids and shading
pcolormesh

pcolormesh

pcolormesh
Advanced quiver and quiverkey functions

Advanced quiver and quiverkey functions

Advanced quiver and quiverkey functions
Tricontour Demo

Tricontour Demo

Tricontour Demo
Tricontour Smooth Delaunay

Tricontour Smooth Delaunay

Tricontour Smooth Delaunay
Tricontour Smooth User

Tricontour Smooth User

Tricontour Smooth User
Trigradient Demo

Trigradient Demo

Trigradient Demo
Tripcolor Demo

Tripcolor Demo

Tripcolor Demo
Triplot Demo

Triplot Demo

Triplot Demo
Axes Demo

Axes Demo

Axes Demo
Controlling view limits using margins and sticky_edges

Controlling view limits using margins and sticky_edges

Controlling view limits using margins and sticky_edges
Resizing axes with constrained layout

Resizing axes with constrained layout

Resizing axes with constrained layout
Resizing axes with tight layout

Resizing axes with tight layout

Resizing axes with tight layout
Figure labels: suptitle, supxlabel, supylabel

Figure labels: suptitle, supxlabel, supylabel

Figure labels: suptitle, supxlabel, supylabel
Invert Axes

Invert Axes

Invert Axes
Secondary Axis

Secondary Axis

Secondary Axis
Figure subfigures

Figure subfigures

Figure subfigures
Creating multiple subplots using ``plt.subplots``

Creating multiple subplots using plt.subplots

Creating multiple subplots using ``plt.subplots``
Box plots with custom fill colors

Box plots with custom fill colors

Box plots with custom fill colors
Plot a confidence ellipse of a two-dimensional dataset

Plot a confidence ellipse of a two-dimensional dataset

Plot a confidence ellipse of a two-dimensional dataset
Violin plot customization

Violin plot customization

Violin plot customization
Different ways of specifying error bars

Different ways of specifying error bars

Different ways of specifying error bars
Including upper and lower limits in error bars

Including upper and lower limits in error bars

Including upper and lower limits in error bars
Hexagonal binned plot

Hexagonal binned plot

Hexagonal binned plot
Using histograms to plot a cumulative distribution

Using histograms to plot a cumulative distribution

Using histograms to plot a cumulative distribution
Some features of the histogram (hist) function

Some features of the histogram (hist) function

Some features of the histogram (hist) function
The histogram (hist) function with multiple data sets

The histogram (hist) function with multiple data sets

The histogram (hist) function with multiple data sets
Bar of pie

Bar of pie

Bar of pie
Labeling a pie and a donut

Labeling a pie and a donut

Labeling a pie and a donut
Polar plot

Polar plot

Polar plot
Using accented text in Matplotlib

Using accented text in Matplotlib

Using accented text in Matplotlib
Scale invariant angle label

Scale invariant angle label

Scale invariant angle label
Angle annotations on bracket arrows

Angle annotations on bracket arrows

Angle annotations on bracket arrows
Date tick labels

Date tick labels

Date tick labels
Labeling ticks using engineering notation

Labeling ticks using engineering notation

Labeling ticks using engineering notation
Using a ttf font file in Matplotlib

Using a ttf font file in Matplotlib

Using a ttf font file in Matplotlib
Labelling subplots

Labelling subplots

Labelling subplots
Legend Demo

Legend Demo

Legend Demo
Mathtext

Mathtext

Mathtext
Math fontfamily

Math fontfamily

Math fontfamily
Multiline

Multiline

Multiline
Rendering math equations using TeX

Rendering math equations using TeX

Rendering math equations using TeX
Text Commands

Text Commands

Text Commands
Title positioning

Title positioning

Title positioning
Color Demo

Color Demo

Color Demo
Creating a colormap from a list of colors

Creating a colormap from a list of colors

Creating a colormap from a list of colors
Line, Poly and RegularPoly Collection with autoscaling

Line, Poly and RegularPoly Collection with autoscaling

Line, Poly and RegularPoly Collection with autoscaling
Compound path

Compound path

Compound path
Mmh Donuts!!!

Mmh Donuts!!!

Mmh Donuts!!!
Line Collection

Line Collection

Line Collection
Bezier Curve

Bezier Curve

Bezier Curve
Bayesian Methods for Hackers style sheet

Bayesian Methods for Hackers style sheet

Bayesian Methods for Hackers style sheet
Dark background style sheet

Dark background style sheet

Dark background style sheet
FiveThirtyEight style sheet

FiveThirtyEight style sheet

FiveThirtyEight style sheet
Make room for ylabel using axes_grid

Make room for ylabel using axes_grid

Make room for ylabel using axes_grid
Axis Direction

Axis Direction

Axis Direction
Anatomy of a figure

Anatomy of a figure

Anatomy of a figure
XKCD

XKCD

XKCD
pyplot animation

pyplot animation

pyplot animation
Cross hair cursor

Cross hair cursor

Cross hair cursor
Data Browser

Data Browser

Data Browser
Keypress event

Keypress event

Keypress event
Lasso Demo

Lasso Demo

Lasso Demo
Legend Picking

Legend Picking

Legend Picking
Looking Glass

Looking Glass

Looking Glass
Path Editor

Path Editor

Path Editor
Pick Event Demo

Pick Event Demo

Pick Event Demo
Pick Event Demo2

Pick Event Demo2

Pick Event Demo2
Poly Editor

Poly Editor

Poly Editor
Trifinder Event Demo

Trifinder Event Demo

Trifinder Event Demo
Viewlims

Viewlims

Viewlims
Packed-bubble chart

Packed-bubble chart

Packed-bubble chart
Rasterization for vector graphics

Rasterization for vector graphics

Rasterization for vector graphics
Zorder Demo

Zorder Demo

Zorder Demo
Demo of 3D bar charts

Demo of 3D bar charts

Demo of 3D bar charts
Lorenz attractor

Lorenz attractor

Lorenz attractor
3D wireframe plots in one direction

3D wireframe plots in one direction

3D wireframe plots in one direction
Asinh Demo

Asinh Demo

Asinh Demo
Loglog Aspect

Loglog Aspect

Loglog Aspect
Exploring normalizations

Exploring normalizations

Exploring normalizations
Scales

Scales

Scales
Radar chart (aka spider or star chart)

Radar chart (aka spider or star chart)

Radar chart (aka spider or star chart)
Topographic hillshading

Topographic hillshading

Topographic hillshading
Spines

Spines

Spines
Spine placement

Spine placement

Spine placement
Dropped spines

Dropped spines

Dropped spines
Colorbar Tick Labelling

Colorbar Tick Labelling

Colorbar Tick Labelling
Custom tick formatter for time series

Custom tick formatter for time series

Custom tick formatter for time series
Date Precision and Epochs

Date Precision and Epochs

Date Precision and Epochs
Move x-axis tick labels to the top

Move x-axis tick labels to the top

Move x-axis tick labels to the top
Artist tests

Artist tests

Artist tests
Group barchart with units

Group barchart with units

Group barchart with units
Evans test

Evans test

Evans test
Annotated Cursor

Annotated Cursor

Annotated Cursor
Rectangle and ellipse selectors

Rectangle and ellipse selectors

Rectangle and ellipse selectors
Span Selector

Span Selector

Span Selector
Quick start guide

Quick start guide

Quick start guide
Image tutorial

Image tutorial

Image tutorial
Artist tutorial

Artist tutorial

Artist tutorial
Styling with cycler

Styling with cycler

Styling with cycler
Constrained Layout Guide

Constrained Layout Guide

Constrained Layout Guide
Tight Layout guide

Tight Layout guide

Tight Layout guide
Transformations Tutorial

Transformations Tutorial

Transformations Tutorial
Specifying colors

Specifying colors

Specifying colors
Colormap Normalization

Colormap Normalization

Colormap Normalization
Text in Matplotlib Plots

Text in Matplotlib Plots

Text in Matplotlib Plots