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.
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.
Contact Us