【发布时间】:2013-12-09 12:45:01
【问题描述】:
我正在尝试连接情节中的点并尝试geom_point()+geom_line(),但它不起作用。
下面的代码只是为了点。有谁知道为什么geom_line() 不添加任何行?
DensityE = read.csv("DensityElk.csv", header = TRUE)
str(DensityE)
DensityE$Date <- factor(DensityE$Date, levels=
c("20-May","3-Jun",
"17-Jun","1-Jul","16-Jul",
"22-Jul", "15-Aug"), order=TRUE)
ggplot(data=DensityE, aes(Date,Density)) +
geom_point(aes(shape = factor(Genus)), size = 4,
position="jitter") +
theme_bw() + xlab("Date") +
ylab("Density per m2") + ggtitle("COP 1992") +
opts(legend.key = theme_blank()) +
opts (legend.title = theme_blank())+
opts(legend.text = theme_text(size=9))
【问题讨论】:
-
请加reproducible example。
DensityElk.csv长什么样子? -
您好,数据的子集是:1-Jul Epeorus 3.5 16-Jul Epeorus 3.25 22-Jul Epeorus 1 3-Jun Rhyacophila 1 17-Jun Rhyacophila 0.75
-
非常感谢您的帮助!我之前确实尝试过在堆栈流上使用代码,但没有任何效果。