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 titlesare positioned above the Axes in the center, flush with the leftedge, and flush with the right edge.
- Parameters:
- labelstr
Text to use for the title
- fontdictdict
Discouraged
The use offontdict is discouraged. Parameters should be passed asindividual keyword arguments or using dictionary-unpacking
set_title(...,**fontdict).A dictionary controlling the appearance of the title text,the defaultfontdict 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). IfNone (the default) and
rcParams["axes.titley"](default:None) is also None, y isdetermined 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:
TextThe matplotlib text instance representing the title
- Other Parameters:
Examples usingmatplotlib.axes.Axes.set_title#
Line, Poly and RegularPoly Collection with autoscaling
Plot a confidence ellipse of a two-dimensional dataset
The histogram (hist) function with multiple data sets
Controlling view limits using margins and sticky_edges