R: Scatter Plot with Density Margins

scatterdens {swfscMisc} | R Documentation

## Scatter Plot with Density Margins

### Description

Produce a scatter plot with a histogram or density plot in the margins

### Usage

    scatterdens(x, y, dens.frac = 1/5, ...)

    scatterhist(x, y, xlab = "", ylab = "", dens.frac = 1/5, ...)

### Arguments

`x, y` | vectors of points to plot.
`dens.frac` | fraction of screen to be taken up by density plots on margins.
`...` | Arguments to be passed to plot.
`xlab, ylab` | labels for x and y axes.

### Author(s)

Eric Archer eric.archer@noaa.gov

### References

Original code by Ken Kleiman: http://sas-and-r.blogspot.co.uk/2011/06/example-841-scatterplot-with-marginal.html

### Examples

    x <- rnorm(100)
    y <- rlnorm(100)
    op <- par(ask = TRUE)
    scatterdens(x, y, xlab = "x", ylab = "y")
    par(op)

[Package swfscMisc version 1.2 Index]