You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RcParams deprecation warnings in matplotlib <3.1.0 #196
First of all, thank you for creating the library. I was frustrated with writing long codes just to generate a simple plot.
This library came to rescue.
MatplotlibDeprecationWarning:
The examples.directory rcparam was deprecated in Matplotlib 3.0 and will be removed in 3.2. In the future, examples will be found relative to the 'datapath' directory.
self[key] = other[key]
I don't think this issue is specific to proplot -- do you get the warning message by just running import matplotlib? It appears you have a matplotlibrc or .proplotrc file with the deprecated parameter name 'examples.directory'.
Check out the contents of your local matplotlibrc to see if it has an uncommented examples.directory line. You can find the location of this file by running the following:
Since, it is just a warning so we can ignore it for the time being.
Sounds good.
do you get the warning message by just running import matplotlib?
No. Everything works just fine. No warnings at all.
When you get the time, could you post the resulting error message when you run the following code?
importmatplotlibasmplimportwarningswarnings.simplefilter('error', mpl.MatplotlibDeprecationWarning)
importproplot# should trigger error and print full traceback
@lukelbd
When you get the time, could you post the resulting error message when you run the following code?
import matplotlib as mpl
import warnings
warnings.simplefilter('error', mpl.MatplotlibDeprecationWarning)
import proplot # should trigger error and print full traceback
Output
Traceback (most recent call last):
File "<ipython-input-1-b76332bb521a>", line 4, in <module>
import proplot # should trigger error and print full traceback
File "C:\Users\Ghost\miniconda3\lib\site-packages\proplot\__init__.py", line 8, in <module>
from .config import * # noqa: F401 F403
File "C:\Users\Ghost\miniconda3\lib\site-packages\proplot\config.py", line 1571, in <module>
_ = RcConfigurator()
File "C:\Users\Ghost\miniconda3\lib\site-packages\proplot\config.py", line 240, in __init__
self.reset(local=local, user=user, default=default)
File "C:\Users\Ghost\miniconda3\lib\site-packages\proplot\config.py", line 805, in reset
rc_matplotlib.update(_get_style_dicts('original', filter=False))
File "C:\Users\Ghost\miniconda3\lib\_collections_abc.py", line 841, in update
self[key] = other[key]
File "C:\Users\Ghost\miniconda3\lib\site-packages\matplotlib\__init__.py", line 794, in __setitem__
"3.0", name=key, obj_type="rcparam", addendum="In the "
File "C:\Users\Ghost\miniconda3\lib\site-packages\matplotlib\cbook\deprecation.py", line 114, in warn_deprecated
_warn_external(warning)
File "C:\Users\Ghost\miniconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 2078, in _warn_external
warnings.warn(message, category, stacklevel)
MatplotlibDeprecationWarning:
The examples.directory rcparam was deprecated in Matplotlib 3.0 and will be removed in 3.2. In the future, examples will be found relative to the 'datapath' directory.
Glad the upgrade fixed it! Thanks for posting the traceback, I'll try to fix that at some point in the future (want to keep proplot compatible with earlier matplotlib versions)
Hi,
thank you very much for your work with this package also from my side! I'm posting this here because it might be related as I also got the same deprecation warning under matplotlib version 3.1.0. Now that I have updated matplotlib to the latest version (3.4.2) I get the following error message:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-4f428cb88cea> in <module>
1 import matplotlib.pyplot as plt
----> 2 import proplot as plot
~/.local/lib/python3.7/site-packages/proplot/__init__.py in <module>
6 # In the future we will not import the class names
7 import pkg_resources as _pkg
----> 8 from .config import * # noqa: F401 F403
9 from .internals import timers
10 with timers._benchmark('imports'):
~/.local/lib/python3.7/site-packages/proplot/config.py in <module>
1569
1570 with timers._benchmark('rc'):
-> 1571 _ = RcConfigurator()
1572
1573 #: Instance of 'RcConfigurator'. This is used to change global settings.
~/.local/lib/python3.7/site-packages/proplot/config.py in __init__(self, local, user, default)
238 """
239 self._context = []
--> 240 self.reset(local=local, user=user, default=default)
241
242 def __enter__(self):
~/.local/lib/python3.7/site-packages/proplot/config.py in reset(self, local, user, default)
803 # NOTE: see _remove_blacklisted_style_params bugfix
804 if default:
--> 805 rc_matplotlib.update(_get_style_dicts('original', filter=False))
806 rc_matplotlib.update(rcsetup._rc_matplotlib_default)
807 rc_proplot.update(rcsetup._rc_proplot_default)
~/.local/lib/python3.7/site-packages/proplot/config.py in _get_style_dicts(style, infer, filter)
1151
1152 # Always apply the default style *first* so styles are rigid
-> 1153 kw_matplotlib = _get_default_dict()
1154 if style == 'default' or style is mpl.rcParamsDefault:
1155 return kw_matplotlib
~/.local/lib/python3.7/site-packages/proplot/config.py in _get_default_dict()
1093 # filter them out. Beware if hidden attribute changes.
1094 rcdict = _get_filtered_dict(mpl.rcParamsDefault, warn=False)
-> 1095 with cbook._suppress_matplotlib_deprecation_warning():
1096 rcdict = dict(RcParams(rcdict))
1097 for attr in ('_deprecated_remain_as_none', '_deprecated_set'):
AttributeError: module 'matplotlib.cbook' has no attribute '_suppress_matplotlib_deprecation_warning'
after importing both matplotlib.pyplot and proplot:
import matplotlib.pyplot as plt
import proplot as plot
@pabloconrat Currently, the latest version of matplotlib (3.4.2) breaks the proplot. See #248 for more details. You can downgrade your matplotlib to 3.3.4. This should work.
@pratiman-91 I tried that but that didn't do the trick. Going further back works though. My problem is that other projects require the new Matplotlib version but thank's for pointing out that issue and great to see that it's already on the agenda :)
The 3.3 and 3.4 compatibility issues are now fixed by #251 (also see #248). You can upgrade to the "development" branch that has these changes using pip install git+https://github.com/lukelbd/proplot.git. Though will try to push a stable version 0.7 in the next few days.
This was finally closed by f0230f1. Importing proplot will no longer trigger a deprecation warning (have been working on more robust testing / dependency management).
There was also an issue preventing basic proplot usage in matplotlib < 3.1.2 due to rcsetup.validate_fontweight not being defined. Fixed this in 1d2d05b.
Activity
lukelbd commentedon Jun 21, 2020
Glad you find it useful!
I don't think this issue is specific to proplot -- do you get the warning message by just running
import matplotlib? It appears you have amatplotlibrcor.proplotrcfile with the deprecated parameter name'examples.directory'.Check out the contents of your local
matplotlibrcto see if it has an uncommentedexamples.directoryline. You can find the location of this file by running the following:You should also check the
~/.proplotrcfile for an uncommentedexamples.directoryline.This matplotlib page gives some useful info on how matplotlib "rcparams" work.
pratiman-91 commentedon Jun 22, 2020
do you get the warning message by just running
import matplotlib?No. Everything works just fine. No warnings at all.
I found the problem, it is related to
_collections_abc.py. Check this link.I do not know how
proplotand_collections_abc.pyare related. \Since, it is just a warning so we can ignore it for the time being.
lacstorm commentedon Jun 22, 2020
Maybe you could fix this by updating matplotlib to the latest version.
lukelbd commentedon Jun 22, 2020
@pratiman-91
Sounds good.
When you get the time, could you post the resulting error message when you run the following code?
@lacstorm
Yep this also may fix it, but since
import matplotlibdoes not trigger the error, sounds like it's a proplot issue.lacstorm commentedon Jun 22, 2020
@lukelbd
When I use matplotlib v3.1.3, I got the same warning. But this just disappear when I update matplotlib to the newest v 3.2.2.
pratiman-91 commentedon Jun 22, 2020
@lukelbd
When you get the time, could you post the resulting error message when you run the following code?
Output
@lacstorm
Yes! It solves the problem.
lukelbd commentedon Jun 22, 2020
@pratiman-91
Glad the upgrade fixed it! Thanks for posting the traceback, I'll try to fix that at some point in the future (want to keep proplot compatible with earlier matplotlib versions)
pratiman-91 commentedon Jun 22, 2020
Thanks for your help!
pabloconrat commentedon Jun 27, 2021
Hi,
thank you very much for your work with this package also from my side! I'm posting this here because it might be related as I also got the same deprecation warning under matplotlib version 3.1.0. Now that I have updated matplotlib to the latest version (3.4.2) I get the following error message:
after importing both matplotlib.pyplot and proplot:
I'm using ProPlot's version 0.6.4.
pratiman-91 commentedon Jun 27, 2021
@pabloconrat Currently, the latest version of matplotlib (3.4.2) breaks the proplot. See #248 for more details. You can downgrade your matplotlib to 3.3.4. This should work.
pabloconrat commentedon Jun 29, 2021
@pratiman-91 I tried that but that didn't do the trick. Going further back works though. My problem is that other projects require the new Matplotlib version but thank's for pointing out that issue and great to see that it's already on the agenda :)
lukelbd commentedon Jun 29, 2021
The 3.3 and 3.4 compatibility issues are now fixed by #251 (also see #248). You can upgrade to the "development" branch that has these changes using
pip install git+https://github.com/lukelbd/proplot.git. Though will try to push a stable version 0.7 in the next few days.[-]Matplotlib Deprecation Warning: rcparam[/-][+]RcParams deprecation warnings in matplotlib <3.1.0[/+]pabloconrat commentedon Jul 6, 2021
Thanks so much!
lukelbd commentedon Jan 24, 2022
This was finally closed by f0230f1. Importing proplot will no longer trigger a deprecation warning (have been working on more robust testing / dependency management).
lukelbd commentedon Jan 24, 2022
There was also an issue preventing basic proplot usage in matplotlib < 3.1.2 due to
rcsetup.validate_fontweightnot being defined. Fixed this in 1d2d05b.