matplotlib Closing a figure window

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • plt.close() # closes the current active figure
  • plt.close(fig) # closes the figure with handle 'fig'
  • plt.close(num) # closes the figure number 'num'
  • plt.close(name) # closes the figure with the label 'name'
  • plt.close('all') # closes all figures


Got any matplotlib Question?