r - two ggplots on one -
i have 2 ggplots. can somehow paint them on 1 picture? 1 background of code :
ggplot(data = dd, aes(x = x, y = y)) + + geom_point(colour="red", size = 3, aes(alpha=col)) ggplot(data=df, aes(x=x, y=y)) + geom_segment(aes(xend=x+dx, yend=y+dy), arrow = arrow(length = unit(0.3,"cm")))
thanks
with ggplot2 can plot info different sources specifying different data
argument different geom_*
. :
library(grid) df <- data.frame(x=runif(10),y=runif(10),dx=rnorm(10),dy=rnorm(10)) dd <- data.frame(x=runif(15), y=runif(15)) ggplot() + geom_point(data=dd, aes(x=x, y=y), col="red") + geom_segment(data=df, aes(x=x, y=y, xend=x+dx, yend=y+dy), arrow = arrow(length = unit(0.3,"cm")))
is trying ?
r ggplot2
No comments:
Post a Comment