【发布时间】:2020-08-06 08:49:00
【问题描述】:
升级matplotlib 和jupyter、jupyter lab 后,内联魔法会产生弃用警告。虽然这有点帮助,但这些警告会妨碍您。
当然可以关闭警告:
import warnings warnings.filterwarnings('ignore')
但这似乎不是最好的方法。
问题:如何在不关闭所有警告的情况下解决这些警告?
魔法:
%pylab inline
警告:
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle:
The text.latex.preview rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle:
The mathtext.fallback_to_cm rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle: Support for setting the 'mathtext.fallback_to_cm' rcParam is deprecated since 3.3 and will be removed two minor releases later; use 'mathtext.fallback : 'cm' instead.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle:
The validate_bool_maybe_none function was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle:
The savefig.jpeg_quality rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle:
The keymap.all_axes rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle:
The animation.avconv_path rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle:
The animation.avconv_args rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
【问题讨论】:
-
_classic_test.mplstyle用于测试,见here。我想你可以简单地删除它。 -
删除后警告消失。不过,这似乎是一种解决方法。我尝试卸载
matplotlib,就像在 github 问题中一样,这没有帮助。
标签: python matplotlib jupyter-notebook jupyter jupyter-lab