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
Discouraged
The use of fontdict is discouraged. Parameters should be passed as individual keyword arguments or using dictionary-unpacking
set_title(..., **fontdict)
.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:
Examples using matplotlib.axes.Axes.set_title
#
Make room for ylabel using axes_grid
Colors in the default property cycle
Create a colormap from a list of colors
Ways to set a color's alpha value
Interactive adjustment of colormap range
Contour plot of irregularly spaced data
Advanced quiver and quiverkey functions
Bar chart with individual bar colors
fill_between with transparency
Fill the area between two lines
Fill the area between two vertical lines
Rasterization for vector graphics
3D wireframe plots in one direction
Error bar rendering on polar axis
Line, Poly and RegularPoly Collection
Plot multiple lines using a LineCollection
Radar chart (aka spider or star chart)
Plot a confidence ellipse of a two-dimensional dataset
Different ways of specifying error bars
Including upper and lower limits in error bars
The histogram (hist) function with multiple data sets
Histogram bins, density, and weight
Bayesian Methods for Hackers style sheet
Controlling view limits using margins and sticky_edges
Resize Axes with constrained layout
Figure labels: suptitle, supxlabel, supylabel
Create multiple subplots using plt.subplots
Angle annotations on bracket arrows
Format ticks using engineering notation
Render math equations using TeX
Custom tick formatter for time series
Move x-axis tick labels to the top
Rectangle and ellipse selectors