has2k1 / plotnine

A Grammar of Graphics for Python
https://plotnine.org
MIT License
4.05k stars 216 forks source link

Feature Request: Add alternative (quicker) density estimation options for `stat_density` #573

Open artificialsoph opened 2 years ago

artificialsoph commented 2 years ago

I notice that in plotnine/stats/density.py there's support for several methods of calculating density but stat_density is locked into using statsmodels KDEUnivariate https://github.com/has2k1/plotnine/blob/a81b8f92bc39b6835e506e6779a01e4b8c53a627/plotnine/stats/stat_density.py#L177

I would love to be able to select a faster/more efficient method for computing densities so that performance can be more similar to seaborn in this respect.

Please let me know if I can help through a PR

has2k1 commented 2 years ago

That makes sense, but is it possible without breaking changes? Give it a go and we'll see how to sort it out.