There is a clear figure command, and it should do it for you:
plt.clf()
If you have multiple subplots in the same figure
plt.cla()
clears the current axes.
More Related Contents:
- How do I change the size of figures drawn with Matplotlib?
- Annotate bars with values on Pandas bar plots
- Break // in x axis of matplotlib [duplicate]
- Matplotlib y axis values are not ordered [duplicate]
- Adding a legend to PyPlot in Matplotlib in the simplest manner possible
- Plot two histograms on single chart with matplotlib
- What is the difference between pylab and pyplot? [duplicate]
- Why do many examples use `fig, ax = plt.subplots()` in Matplotlib/pyplot/python
- How to set xlim and ylim for a subplot in matplotlib [duplicate]
- Paging/scrolling through set of 2D heat maps in matplotlib
- Axes class – set explicitly size (width/height) of axes in given units
- Matplotlib plot with variable line width
- Modify the legend of pandas bar plot
- Changing plot scale by a factor in matplotlib
- Plot curve with blending line colors with matplotlib/pyplot
- Specifying the order of matplotlib layers
- Using Matplotlib 3D axes, how to drag two axes at once
- Increase the speed of redrawing contour plot in matplotlib
- Changing the tick frequency on the x or y axis
- How to remove lines in a Matplotlib plot
- pandas bar plot combined with line plot shows the time axis beginning at 1970
- How to plot time series in python
- Plotting time in with Matplotlib
- making matplotlib scatter plots from dataframes in Python’s pandas
- Understanding matplotlib: plt, figure, ax(arr)?
- Plotting a line over several graphs
- Move spines in matplotlib 3d plot?
- How to remove/omit smaller contour lines using matplotlib
- How do I align gridlines for two y-axis scales?
- Specifying the order of layers