Like a box plot, a quartile plot summarises a distribution with five statistics: the median (the dot); the upper quartile and the maximum value (either end of the upper centre line); and the lower quartile and the minimum value (either end of the lower centre line). However, a quartile plot reduces a box plot's glyphs to one dot and two lines, so it has a larger data-ink ratio.
For more information about quartile plots, see:
- Tufte, E.R., 2001. The Visual Display of Quantitative Information. 2nd ed. Cheshire, CT, USA: Graphics Press.
Refractive indices of samples of six types of glass, gathered for criminological investigation (source).
d3.svg.quartileplot()
Creates a new quartile plot.
quartileplot(selection)
Applies the quartile plot to a selection or transition. The selection must contain an SVG or G element.
quartileplot.domain([values])
If values is specified, sets the quartile plot's input domain to the specified array of numbers. The array must contain two elements: the minimum and maximum values. If values is not specified, returns the current domain or null
if no domain has been specified.
quartileplot.duration([duration])
If duration is specified, sets the quartile plot's median circle and centre lines to transition over the specified duration in milliseconds. If duration is not specified, returns the current duration.
quartileplot.height([height])
If height is specified, sets the quartile plot's height. If height is not specified, returns the current height.
quartileplot.radius([radius])
If radius is specified, sets the radius of the quartile plot's median and outlier circles. If radius is not specified, returns the current radius.
quartileplot.whiskers([accessor])
If accessor is specified, sets the function used to compute the quartile plot's whiskers. This function will be passed an array of numbers (in ascending order) from the data bound to the current selection. It should return an array of two elements: the values of the lower and upper whiskers. If accessor is not specified, returns the current whiskers accessor or null
if no whiskers accessor has been specified.
quartileplot.y([accessor])
If accessor is specified, sets the function used to access the values from the data bound to the current selection. If accessor is not specified, returns the current accessor function.
quartileplot.yScale([scale])
If scale is specified, sets the scale for the y axis. If accessor is not specified, returns the current y scale. Default y scale is d3.scale.linear
.