ENH/CLN: add HistPlot class inheriting MPLPlot by sinhrks · Pull Request #7809 · pandas-dev/pandas (original) (raw)
Because hist
and boxplot
are separated from normal plot
, there are some inconsistencies with these functions. Looks better to include them to MPLPlot
framework.
Maybe scatter
and hist
can be deprecated in 0.15 if MPLPlot
can offer better GroupBy
plot (plan to do in separate PR).
Example
This allows to use kind='hist
in DataFrame.plot
and Series.plot
. (No changes for DataFrame.hist
)
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df = pd.DataFrame(np.random.randn(1000, 5))
df.plot(kind='hist', subplots=True)
df.plot(kind='hist', stacked=True)
Remaining Items
- Add a release note in API section detailing this change/enhancement
- Modify doc
- Add tests (both histogram and kde)
- Add support for
rot
andfontsize
(depending onorientation
kw) (rely on BUG/VIS: rot and fontsize are not applied to timeseries plots #7844) - Add tests for xticklabels and yticklabels
- Add tests for colors
- Handling nan
- Add support for
- Check
stacked=True
can be supported (DataFrame.hist
doesn't support it though..).- Add tests for stacking