You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 3.1.1.post1906+g5e3bede9d
Fork me on GitHub

Table of Contents


Axes.set_title(self, label, fontdict=None, loc=None, pad=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.

label : str

Text to use for the title

fontdict : dict

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'}, str, optional

Which title to set. If None, defaults to rcParams["axes.titlelocation"].

pad : float

The offset of the title from the top of the axes, in points. If None, defaults to rcParams["axes.titlepad"].

text : Text

The matplotlib text instance representing the title

Other Parameters:
**kwargs : Text properties

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