Description Usage Arguments References See Also Examples
axis0
- Adjust Space Between x/y Axis in ggplot2.
x0
- Adjust Space Between x Axis in ggplot2.
y0
- Adjust Space Between y Axis in ggplot2.
1 2 3 4 5 |
max |
The upper/right-most edge (upper ylim/xlim numeric value). |
scale |
A ggplot scale type (e.g. "continuous", "discrete", etc.) |
axis |
The axis to operate on ("x" or "y"). |
http://stackoverflow.com/a/20220737/1000343.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
ggplot(reorder_by(cyl, ~-cyl , mtcars, length), aes(x=as.factor(cyl))) +
geom_bar() +
theme_apa() +
y0(cushion(as.factor(mtcars$cyl))) +
xlab("Cylinders") +
ylab("Total")
library(dplyr)
mtcars2 <- mtcars %>% group_by(cyl) %>% summarise(n=length(cyl))
ggplot(mtcars2, aes(y=as.factor(cyl), x=n)) +
geom_point() +
theme_apa() +
x0(16)
ggplot(mtcars, aes(x=hp, y=mpg)) +
geom_point() +
theme_apa() +
x0(max(mtcars$hp) + 10) +
y0(max(mtcars$mpg) + 5)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.