To eliminate the maxopenwarning output in matplotlib, you can set the matplotlibrc parameter "figure.maxopenwarning" to 0, either by adding the following to your script or creating/modifying the matplotlib configuration file "matplotlibrc":
import matplotlib as mpl
mpl.rcParams['figure.max_open_warning'] = 0
Alternatively, you can use the following code to suppress the warning message:
import warnings
warnings.filterwarnings("ignore", message=".*Attempting to set identical left==right results.*")
This suppresses the specific warning message that is displayed when the maximum number of open figures is reached.
Asked: 2023-01-06 11:00:00 +0000
Seen: 8 times
Last updated: Aug 04 '22