Description Usage Arguments Value Author(s) See Also Examples
View source: R/position_identityx.r
adjust identity position which can be shifted vertically or horizontally.
1 | position_identityx(hexpand = NA, vexpand = NA)
|
hexpand |
numeric, distance to be shifted horizontally for geoms that have a position, default is NA. |
vexpand |
numeric, distance to be shifted vertically for geoms that have a position, default is NA. |
position method.
Shuangbin Xu
Other position adjustments:
position_dodgex()
,
position_points_sinax()
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(ggplot2)
library(patchwork)
p <- ggplot(mtcars, aes(x=wt, y=mpg))
p1 <- p + geom_point(position=position_identityx()) + ylim(0, 50)
# whole point layer was shifted vertically (distance=5).
# the label of axis y should be subtracted 5 to get the true value..
p2 <- p + geom_point(position=position_identityx(vexpand=5)) + ylim(0, 50)
# whole point layer was shifted horizontally (distance=5).
# the label of axis x should be subtracted 5 to get the true value.
p3 <- ggplot(mtcars, aes(y=wt, x=mpg)) +
geom_point(position=position_identityx(hexpand=5)) + xlim(0, 50)
p4 <- p1 + p2 + p3
p4
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.