Description Usage Arguments Value Examples
gg_rescale
rescales the given ggplot2 so that the axes follow the
given ratio (horizontally). If a plot is not specified, the last plot
displayed is used.
gg_rescale_golden
rescales a ggplot2 plot so that axes
follow golden ratio
gg_rescale_square
rescales a ggplot2 plot so that its
axes are square
1 2 3 4 5 | gg_rescale(plot = last_plot(), ratio)
gg_rescale_golden(plot = last_plot(), orient = "h")
gg_rescale_square(plot = last_plot())
|
plot |
A ggplot2 plot object. By default, the last plot displayed is used. |
ratio |
The aspect ratio to use for the axes. This is independent of units used in the plot, so the size of the X axis will be ratio times the total size of the Y axis. |
orient |
Whether the golden ratio should be horizontal
( |
A modified ggplot2 plot
1 2 3 | p <- ggplot(mtcars, aes(x = cyl, y = mpg)) +
geom_point(shape = 1)
gg_rescale(ratio = 1.67)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.