Skip to content

Improve kde_plot

Emanuele Roberto Nocera requested to merge betterkde into master

Created by: Zaharid

This tends to be one of the functions I import most from validphys. It is a good way to get an idea of how a given array looks like, and in particular it is much better than an histogram. This is also designed to play nice with other things you want to add on top of the plot (such as another kde_plot).

The implementation did have some problems: For one it was unusable with large data samples, because axhline is just too slow. Instead use the much more efficient LineCollection interface (which also makes it a bit clunky to get the same result) and apply some rate limiting mechanism.

Also remove some ridiculous option to make the rugs vertical (I think it comes from seaborn, from where we stole this) which is not matched with the KDE, and add explicit keywords arguments for the things we use rather than playing games with kwargs.

Merge request reports

Loading