VOOZH about

URL: https://www.geeksforgeeks.org/python/matplotlib-figure-figure-set_figwidth-in-python/

⇱ Matplotlib.figure.Figure.set_figwidth() in Python - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Matplotlib.figure.Figure.set_figwidth() in Python

Last Updated : 12 Jul, 2025
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.set_figwidth() method

The set_figwidth() method figure module of matplotlib library is used to set the width of the figure in inches.
Syntax: set_figwidth(self, val, forward=True) Parameters: This method accept the following parameters that are discussed below:
  • val : This parameter is the float value.
  • forward : This parameter contains the boolean value.
Returns: This method does not returns any value.
Below examples illustrate the matplotlib.figure.Figure.set_figwidth() function in matplotlib.figure: Example 1: Output: 👁 Image
Example 2:
Output: 👁 Image
Comment