Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试查看 MCMC 跟踪的路径,下面的内容plot()显示了我所追求的东西,但是,当我ggplot2在情况,但不是现在。
plot()
ggplot2
set.seed(123) t1 <- data.frame(x=rnorm(20), y=rnorm(20)) plot(t1$x, t1$y, type='b') qplot(t1$x, t1$y, geom=c('point','line'))
我怎样才能得到类似 in 的plot()东西ggplot2?
使用path而不是line. line将从最小到最大的 x 值连接点,但path将按照它们在数据框中的顺序连接它们。
path
line
qplot(t1$x, t1$y, geom=c('point','path'))