Ask Your Question
0

How can the max_open_warning output in matplotlib be eliminated?

asked 2023-01-06 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-08-04 11:00:00 +0000

qstack gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-01-06 11:00:00 +0000

Seen: 8 times

Last updated: Aug 04 '22