Eat matplotlib deprecation warning
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. https://github.com/matplotlib/matplotlib/issues/13118
This commit is contained in:
parent
181f857ae7
commit
b4e8c056e0
|
@ -58,7 +58,9 @@ def test_filterpy_version():
|
||||||
# chapter so the reader can see that they need to update FilterPy.
|
# chapter so the reader can see that they need to update FilterPy.
|
||||||
test_filterpy_version()
|
test_filterpy_version()
|
||||||
|
|
||||||
pylab.rcParams['figure.max_open_warning'] = 50
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore", matplotlib.MatplotlibDeprecationWarning)
|
||||||
|
pylab.rcParams['figure.max_open_warning'] = 50
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
|
@ -110,7 +112,10 @@ def set_style():
|
||||||
style = json.load(open("./kf_book/538.json"))
|
style = json.load(open("./kf_book/538.json"))
|
||||||
else:
|
else:
|
||||||
style = json.load(open(".//kf_book/538.json"), object_hook=_decode_dict)
|
style = json.load(open(".//kf_book/538.json"), object_hook=_decode_dict)
|
||||||
plt.rcParams.update(style)
|
|
||||||
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore", matplotlib.MatplotlibDeprecationWarning)
|
||||||
|
plt.rcParams.update(style)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
np.set_printoptions(suppress=True, precision=3,
|
np.set_printoptions(suppress=True, precision=3,
|
||||||
|
|
Loading…
Reference in New Issue