ggmarginal

fun ggmarginal(sides: String, size: Any? = null, layer: Feature): Feature

Converts given geometry layer to a marginal layer. You can add one or more marginal layers to a plot to create a marginal plot.

A marginal plot is a scatterplot (sometimes a 2D density plot or other bivariate plot) that has histograms, boxplots, or other distribution visualization layers in the margins of the x- and y-axes.

Examples

Return

An object specifying a marginal geometry layer or a list of marginal geometry layers.

Parameters

sides

Which sides of the plot the marginal layer will appear on. It should be set to a string containing any of "trbl", for top, right, bottom and left.

size

Number or List of Numbers. Size of marginal geometry (width or height, depending on the margin side) as a fraction of the entire plotting area of the plot. The value should be in range [0.01..0.95], default = 0.1.

layer

A marginal geometry layer. The result of calling of the geomXxx() / statXxx() function. Marginal plot works best with density, histogram, boxplot, violin and freqpoly geometry layers.