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,6 +58,8 @@ def test_filterpy_version():
|
|||
# chapter so the reader can see that they need to update FilterPy.
|
||||
test_filterpy_version()
|
||||
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", matplotlib.MatplotlibDeprecationWarning)
|
||||
pylab.rcParams['figure.max_open_warning'] = 50
|
||||
|
||||
|
||||
|
@ -110,6 +112,9 @@ def set_style():
|
|||
style = json.load(open("./kf_book/538.json"))
|
||||
else:
|
||||
style = json.load(open(".//kf_book/538.json"), object_hook=_decode_dict)
|
||||
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", matplotlib.MatplotlibDeprecationWarning)
|
||||
plt.rcParams.update(style)
|
||||
except:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue