R 按绘图顺序排列的行
从库R 按绘图顺序排列的行,r,ggplot2,visualization,R,Ggplot2,Visualization,从库mgcv 我得到了要绘制的点: fsb <- fs.boundary(r0=0.1, r=1.1, l=2173) 我现在尝试使用ggplot(这是更大代码中的一行): tpdf您必须指定group参数-例如 ggplot(tpdf) + geom_point(aes(ts, ps)) + geom_line(aes(ts, ps, group = gl(4, 40))) 给我一个类似于R基的图。 这可以通过使用几何路径来解决: ggplot(tpdf)+ geom
mgcv
我得到了要绘制的点:
fsb <- fs.boundary(r0=0.1, r=1.1, l=2173)
我现在尝试使用ggplot(这是更大代码中的一行):
tpdf您必须指定group
参数-例如
ggplot(tpdf) +
geom_point(aes(ts, ps)) +
geom_line(aes(ts, ps, group = gl(4, 40)))
给我一个类似于R基的图。
这可以通过使用几何路径来解决:
ggplot(tpdf)+
geom_point(aes(ts,ps)) +
geom_path(aes(ts,ps))
您使用ggplot
的方式非常奇怪,我建议您重新检查一下
数据:
库(mgcv)
金融稳定委员会
ggplot(tpdf) +
geom_point(aes(ts, ps)) +
geom_line(aes(ts, ps, group = gl(4, 40)))
ggplot(tpdf)+
geom_point(aes(ts,ps)) +
geom_path(aes(ts,ps))
library(mgcv)
fsb <- fs.boundary(r0 = 0.1, r=2, l=13)
tpdf <- data.frame(ts=fsb$x,ps=fsb$y)