Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The
Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute.
matplotlib.axes.Axes.remove() Function
The
Axes.remove() function in axes module of matplotlib library is used to remove the artist from the figure if possible.
Syntax:
Axes.remove(self)
Below examples illustrate the matplotlib.axes.Axes.remove() function in matplotlib.axes:
Example 1:
Output:
👁 Image
Example 2: