coord_equal {ggplot2} | R Documentation |
Equal scale cartesian coordinates
coord_equal(ratio=NULL, ...)
ratio |
NULL |
... |
ignored |
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.
A layer
Hadley Wickham, http://had.co.nz/
## Not run: # ratio = NULL, the default, will modify the aspect ratio of the plot # to qplot(mpg, wt, data = mtcars) + coord_equal() # when ratio = a specific number, ensures that the ranges of axes are # equal to the specified ratio by expanding the smallest axis 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)