Describe the bug
Using the pmdarima.arima.ARIMA.plot_diagnostics always seems to return the following error: "AttributeError: 'Rectangle' object has no property 'normed'"
Expected behavior
Return the plot_diagnostics figure (residual, histogram, normal Q-Q and Correlogram)
Actual behavior
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-44-5a958117d242> in <module>
----> 1 sarima_model.plot_diagnostics(lags=13)
c:\users\XXXXXXXX\XXXXXXXX\XXXXXXXX\venv\lib\site-packages\pmdarima\utils\metaestimators.py in <lambda>(*args, **kwargs)
51
52 # lambda, but not partial, allows help() to work with update_wrapper
---> 53 out = (lambda *args, **kwargs: self.fn(obj, *args, **kwargs))
54 # update the docstring of the returned function
55 update_wrapper(out, self.fn)
c:\users\XXXXXXXX\XXXXXXXX\XXXXXXXX\venv\lib\site-packages\pmdarima\arima\arima.py in plot_diagnostics(self, variable, lags, fig, figsize)
1198 # hist needs to use `density` in future when minimum matplotlib has it
1199 with warnings.catch_warnings(record=True):
-> 1200 ax.hist(resid_nonmissing, normed=True, label='Hist')
1201
1202 kde = gaussian_kde(resid_nonmissing)
c:\users\XXXXXXXX\XXXXXXXX\XXXXXXXX\venv\lib\site-packages\matplotlib\__init__.py in inner(ax, data, *args, **kwargs)
1541 def inner(ax, *args, data=None, **kwargs):
1542 if data is None:
-> 1543 return func(ax, *map(sanitize_sequence, args), **kwargs)
1544
1545 bound = new_sig.bind(ax, *args, **kwargs)
c:\users\XXXXXXXX\XXXXXXXX\XXXXXXXX\venv\lib\site-packages\matplotlib\axes\_axes.py in hist(self, x, bins, range, density, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, color, label, stacked, **kwargs)
6806 if patch:
6807 p = patch[0]
-> 6808 p.update(kwargs)
6809 if lbl is not None:
6810 p.set_label(lbl)
c:\users\XXXXXXXX\XXXXXXXX\XXXXXXXX\venv\lib\site-packages\matplotlib\artist.py in update(self, props)
1004
1005 with cbook._setattr_cm(self, eventson=False):
-> 1006 ret = [_update_property(self, k, v) for k, v in props.items()]
1007
1008 if len(ret):
c:\users\XXXXXXXX\XXXXXXXX\XXXXXXXX\venv\lib\site-packages\matplotlib\artist.py in <listcomp>(.0)
1004
1005 with cbook._setattr_cm(self, eventson=False):
-> 1006 ret = [_update_property(self, k, v) for k, v in props.items()]
1007
1008 if len(ret):
c:\users\XXXXXXXX\XXXXXXXX\XXXXXXXX\venv\lib\site-packages\matplotlib\artist.py in _update_property(self, k, v)
999 func = getattr(self, 'set_' + k, None)
1000 if not callable(func):
-> 1001 raise AttributeError('{!r} object has no property {!r}'
1002 .format(type(self).__name__, k))
1003 return func(v)
AttributeError: 'Rectangle' object has no property 'normed'
It seems to be completely removed from matplotlib version 3.2.0 (released on March 04 2020), but was still present in the documentation of version 3.1.3 (released on February 03 2020).
This argument is used at line 1200 in pmdarima\arima\arima.py
Changing the keyword from "normed" to "density" fixes this bug, and the plot_diagnostics method returns the correct figure.
Describe the bug Using the pmdarima.arima.ARIMA.plot_diagnostics always seems to return the following error: "AttributeError: 'Rectangle' object has no property 'normed'"
To Reproduce
Use the plot_diagnostics method
Versions System: python: 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] machine: Windows-10-10.0.17763-SP0
Python dependencies: pip: 20.0.2 setuptools: 46.0.0 sklearn: 0.22.2.post1 statsmodels: 0.11.1 numpy: 1.18.1 scipy: 1.4.1 Cython: 0.29.15 pandas: 1.0.1 joblib: 0.14.1 pmdarima: 1.5.3
Expected behavior Return the plot_diagnostics figure (residual, histogram, normal Q-Q and Correlogram)
Actual behavior
Additional context The "normed" keyword argument of matplotlib.pyplot.hist is deprecated since version 2.2.0, and has been replaced by the "density" parameter, as can be seen here: https://matplotlib.org/api/_as_gen/matplotlib.pyplot.hist.html#matplotlib.pyplot.hist
It seems to be completely removed from matplotlib version 3.2.0 (released on March 04 2020), but was still present in the documentation of version 3.1.3 (released on February 03 2020).
This argument is used at line 1200 in pmdarima\arima\arima.py Changing the keyword from "normed" to "density" fixes this bug, and the plot_diagnostics method returns the correct figure.