-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
No MatplotlibDeprecationWarning for default rcParams #13118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Until the parameters are actually removed, they are valid and Can you please check your local config file (path can be obtained using |
@timhoffm Thanks for your comment! There is an empty >>> import matplotlib
>>> print(open(matplotlib.matplotlib_fname()).read())
>>> rc_params = matplotlib.rcParams.copy()
>>> rc_params['examples.directory']
''
>>> rc_params['text.latex.unicode']
True I think |
You are right. However, I don't have a clear view how to prevent this. We cannot remove the parameter unconditionally because someone might be relying that it's there. |
I also don't have any solutions… The most troubling thing on this is that these warnings are displayed when using |
I thought we had some machinery to avoid this (or at least a discussion somewhere already). |
I think we catch and discard the warnings internally, I suspect seaborn should do the same. I agree that this is annoying behavior, but I don't see a way around it.
|
I see. Thank you for your responses! I hit upon two solutions, but I don't think they are good.
class RcParams(MutableMapping, dict):
[...]
def wrapped_copy(self):
with warnings.catch_warnings():
warnings.simplefilter("ignore", MatplotlibDeprecationWarning)
return RcParams(self.copy()) |
matplotlib is issuing a deprecation warning whenever you use rcParams, even if you are not using one of the deprecated values. This is very annoying. I eat the deprecation while using rcParams. matplotlib/matplotlib#13118
Bug report
Bug summary
I get MatplotlibDeprecationWarning when putting the default rcParams copied by
matplotlib.rcParams.copy()
intomatplotlib.rcParams.update()
.Code for reproduction
It is because
matplotlib.rcParams.copy()
returns dictionary of rcParams and it includes deprecated rcParams likeexamples.directory
andtext.latex.unicode
. However,examples.directory
andtext.latex.unicode
are included in the default rcParams of matplotlib.Expected outcome
Do not show MatplotlibDeprecationWarning for default rcParams.
Matplotlib version
The text was updated successfully, but these errors were encountered: