addBoxplot: Add a box plot in the margin of a scatterplot

Description Usage Arguments Details Value Author(s) References Examples

View source: R/addBoxplot.R

Description

Add a box plot in the margin of a scatterplot

Usage

1
addBoxplot(x, gap = 0.01, side, outpch = 20)

Arguments

x

a numeric vector, the data to display in the boxplot

gap

distance above or right of the edge of the plot, as a proportion of the width of the plot; negative values will position the boxplot below or left of the edge.

side

1=bottom, 2=left, 3=top, 4=right

outpch

plotting symbol to use for outliers; choose one which won't be confused with the points in the scatterplot.

Details

Box plots of each variable along the appropriate side are a nice idea (cf Quinn & Keough) but take up lots of space and require multiplot layout. As Tufte points out, the box isn't necessary, so this fits a box-ish plot into the frame of the scatter plot.

Value

Nothing; used for its plotting side-effect.

Author(s)

Mike Meredith, 29 April 2012

References

Quinn, G P; M J Keough 2002. Experimental design and data analysis for biologists. Cambridge University Press, Cambridge UK.

Examples

1
2
3
4
data(trees)
plot(Volume ~ Girth, data=trees, bty='l')
addBoxplot(trees$Volume, side=4)
addBoxplot(trees$Girth, side=3)

mikemeredith/MMmisc documentation built on Nov. 8, 2019, 11:34 p.m.