A density plot shows the distribution of a numerical variable. It takes only set of numeric values as input. It is really close to a histogram. Since it is a really common dataviz technique,
most of the dataviz libraries allow to draw it. Note that it is highly recommended to play with the bandwith argument in order not to miss a specific pattern in the data. Note that you can compare the
distribution of several variables plotting them on the same axis, using faceting or through a joyplot.
Sponsors
Input format
To represent a density, you need only one vector of numbers. It can be a list, or the column of a data frame.
If you have several numerical variable, you can plot several densities and compare them, or do a boxplot or violin plot.
Format 1: 1 numerical variable only.
Seaborn
- #70 Basic density plot
- #71 Density plot with shade
- #72 Horizontal densityplot
- #73 Control bandwidth of density plot
- #74 Density plot for several variables
- #82 Custom color of marginal plot
- #82 Custom ratio in marginal plot
related
- HISTOGRAM
- VIOLIN
- BOXPLOT