Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The
figure module provides the top-level Artist, the Figure, which contains all the plot elements. This module is used to control the default spacing of the subplots and top level container for all plot elements.
matplotlib.figure.Figure.subplots_adjust() method
The
subplots_adjust() method figure module of matplotlib library is used to Update the SubplotParams with kwargs.
Syntax: subplots_adjust(self, left=None, bottom=None, right=None, top=None, wspace=None, hspace=None)
Parameters: This method accept the following parameters that are discussed below:
- left : This parameter is the left side of the subplots of the figure.
- right : This parameter is the right side of the subplots of the figure.
- bottom : This parameter is the bottom of the subplots of the figure.
- top : This parameter is the top of the subplots of the figure.
- wspace : This parameter is the amount of width reserved for space between subplots expressed as a fraction of the average axis width.
- hspace : This parameter is the amount of height reserved for space between subplots expressed as a fraction of the average axis height.
Returns: This method does not returns any value.
Below examples illustrate the matplotlib.figure.Figure.subplots_adjust() function in matplotlib.figure:
Example 1:
Output:
👁 Image
Example 2: