Matplotlib.pyplot.close() Syntax in Python

Syntax: matplotlib.pyplot.close(fig=None)

Parameters: This method accept only one parameters.

  1. fig: This parameter accepts the following values:
  2. None: This value will close the current figure
  3. Figure: This value will close the given Figure instance
  4. int: This value will close a figure number
  5. str: This value will close a figure name
  6. ‘all’:This value will close all figures

Returns: This method does not return any values.

Matplotlib.pyplot.close() in Python

Matplotlib close() function in pyplot module of the matplotlib library is used to close a figure window. This function is designed to close a figure window or a set of figure windows. When called without any arguments, it closes the currently active figure. Alternatively, we can pass a figure number or a reference to a figure object as an argument to close a specific figure.

Similar Reads

Matplotlib.pyplot.close() Syntax in Python

Syntax: matplotlib.pyplot.close(fig=None) Parameters: This method accept only one parameters. fig: This parameter accepts the following values: None: This value will close the current figure Figure: This value will close the given Figure instance int: This value will close a figure number str: This value will close a figure name ‘all’:This value will close all figures Returns: This method does not return any values....

Python matplotlib.pyplot.close() Function Example

Below are the examples by which we can understand about how to close Matplotlib figure in Python using Matplotlib.pyplot.close() function:...

Contact Us