coord_equal {ggplot2}R Documentation

coord_equal

Description

Equal scale cartesian coordinates

Usage

coord_equal(ratio=1, ...)

Arguments

ratio NULL
... ignored

Details

An equal scale coordinate system plays a similar role to ?eqscplot in MASS, but it works for all types of graphics, not just scatterplots.

This coordinate system has one parameter, ratio, which specifies the ratio between the x and y scales. An aspect ratio of two means that the plot will be twice as high as wide. An aspection ratio of 1/2 means that the plot will be twice as wide as high. By default, the aspect.ratio of the plot will also be set to this value.

This page describes coord_equal, see layer and qplot for how to create a complete plot from individual components.

Value

A layer

Author(s)

Hadley Wickham, http://had.co.nz/

See Also

Examples

## Not run: 
# coord_equal ensures that the ranges of axes are equal to the
# specified ratio (1 by default, indicating equal ranges).

qplot(mpg, wt, data = mtcars) + coord_equal(ratio = 1)
qplot(mpg, wt, data = mtcars) + coord_equal(ratio = 5)
qplot(mpg, wt, data = mtcars) + coord_equal(ratio = 1/5)

# Resize the plot, and you'll see that the specified aspect ratio is 
# mantained
## End(Not run)

[Package ggplot2 version 0.8.2 Index]