|
13 | 13 | from pandas.tseries.period import PeriodIndex
|
14 | 14 | from pandas.tseries.offsets import DateOffset
|
15 | 15 |
|
| 16 | +def _get_standard_kind(kind): |
| 17 | + return {'density' : 'kde'}.get(kind, kind) |
| 18 | + |
16 | 19 |
|
17 | 20 | def scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False,
|
18 | 21 | diagonal='hist', marker='.', **kwds):
|
@@ -54,7 +57,7 @@ def scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False,
|
54 | 57 | # Deal with the diagonal by drawing a histogram there.
|
55 | 58 | if diagonal == 'hist':
|
56 | 59 | axes[i, j].hist(values)
|
57 |
| - elif diagonal == 'kde': |
| 60 | + elif diagonal in ('kde', 'density'): |
58 | 61 | from scipy.stats import gaussian_kde
|
59 | 62 | y = values
|
60 | 63 | gkde = gaussian_kde(y)
|
@@ -673,7 +676,7 @@ def plot_frame(frame=None, subplots=False, sharex=True, sharey=False,
|
673 | 676 | -------
|
674 | 677 | ax_or_axes : matplotlib.AxesSubplot or list of them
|
675 | 678 | """
|
676 |
| - kind = kind.lower().strip() |
| 679 | + kind = _get_standard_kind(kind.lower().strip()) |
677 | 680 | if kind == 'line':
|
678 | 681 | klass = LinePlot
|
679 | 682 | elif kind in ('bar', 'barh'):
|
@@ -738,6 +741,7 @@ def plot_series(series, label=None, kind='line', use_index=True, rot=None,
|
738 | 741 | -----
|
739 | 742 | See matplotlib documentation online for more on this subject
|
740 | 743 | """
|
| 744 | + kind = _get_standard_kind(kind.lower().strip()) |
741 | 745 | if kind == 'line':
|
742 | 746 | klass = LinePlot
|
743 | 747 | elif kind in ('bar', 'barh'):
|
|
0 commit comments