diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index 7fec6081f405..8619ac919f54 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -188,7 +188,8 @@ def show(cls, block=None): if not managers: return for manager in managers: - manager.show() + if rcParams['figure.show']: + manager.show() if block is None: # Hack: Are we in IPython's pylab mode? from matplotlib import pyplot diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index a4c86779ba4e..8a8f38115a2d 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1289,6 +1289,8 @@ def _validate_linestyle(ls): # This is a buffer around the axes in inches. This is 3pts. 'figure.constrained_layout.h_pad': [0.04167, validate_float], 'figure.constrained_layout.w_pad': [0.04167, validate_float], + # Show the figure on the GUI + 'figure.show': [True, validate_bool], ## Saving figure's properties 'savefig.dpi': ['figure', validate_dpi], # DPI diff --git a/matplotlibrc.template b/matplotlibrc.template index d301ece5200b..4198a64cf079 100644 --- a/matplotlibrc.template +++ b/matplotlibrc.template @@ -455,6 +455,7 @@ backend : $TEMPLATE_BACKEND #figure.constrained_layout.w_pad : 0.04167 ## inches. Default is 3./72. inches (3 pts) #figure.constrained_layout.hspace : 0.02 ## Space between subplot groups. Float representing #figure.constrained_layout.wspace : 0.02 ## a fraction of the subplot widths being separated. +#figure.show : True ## Show the figure on the GUI #### IMAGES #image.aspect : equal ## equal | auto | a number