Skip to main content
100%

Visualizing Distributions

✓ Published0🌍 Public
BBBischof
Last edited Jul 15, 2016
Created on Jul 15, 2016

This example compares four chart types for visualizing one-dimensional distributions. It first displays a swarm plot and a pile plot, which use a force-directed layout to position individual data points without overlap, in this case 700 values generated from a log-normal distribution. The example then shows a histogram, constructed using the `d3.layout.histogram()` function to bin the data, and a boxplot, which uses `d3.scale.quantile()` to compute summary statistics. The swarm and pile plots are built using the `d3.forceChart()` plugin from the `force-chart.js` library.

AI-generated description

A few ways to visualize 1D distributions.

Swarm and pile plots show all the data points but can't be used when there are a lot of data points. Histograms and boxplots work for any number of data points since they are visualizing summary statistics. Histograms provide more information than a boxplot. Boxplots fit in small spaces, making them nice for comparing many distributions side-by-side.

Other chart types for 1D distributions: violin plot, kernel density, empirical CDF.

The d3.forceChart() plugin is used for the swarm and pile plots; d3.layout.histogram() for the histogram; d3.scale.quantile() for the quartile summary statistics used in the boxplot.

forked from <a href='http://bl.ocks.org/armollica/'>armollica</a>'s block: <a href='http://bl.ocks.org/armollica/0f28622e38434b04907d768df6cec684'>Visualizing Distributions</a>

gpl-3.0 Licensed

Similar vizzes