我正在使用此数据https://www.dropbox.com/s/aqt7bdhzlwdsxl2/summary_exp1.csv
和以下代码:
pd <- position_dodge(.1)
ggplot(data=summary.200.exp1, aes(x=Time, y=Length, colour=Genotype, group=Genotype)) +
geom_errorbar(aes(ymin=Length - se, ymax=Length + se), colour="black", width=.1, position=pd) +
geom_line(position=pd) +
geom_point(aes(shape=Genotype),position=pd, size=3) +
ylab("leaf segment width (mm)") +
xlab("Time") +
theme(axis.title = element_text(size=14,face="bold"),
axis.text = element_text(size=14),
strip.text.y = element_text(size=14))
我需要进行以下修改:
time0
之间绘制的数据之间的空间Time22
。我查看了文档并尝试了以下方法:scale_x_discrete(limits=c("0","22"))
,但是它不起作用。geom_text(aes(colour=Genotype))
,但我也无法使用。我将不胜感激。非常感谢
expand = c(0, 0)
比例参数来消除图形和轴之间的空间:scale_x_discrete(expand = c(0, 0))
show_guide=FALSE
的geom_line
一部分来消除图例。编辑:
我认为您正在尝试将大量图形绘制到一张图中。例如,误差线彼此重叠得很多,以获得清晰的图。在这种情况下,使用构面可能是一个好主意(我认为)。以下代码(其中将数据框命名为dat
):
ggplot(data=dat, aes(x=Time, y=Length, colour=Genotype)) +
geom_line() +
geom_point(aes(shape=Genotype), size=3) +
scale_shape_manual(values=c(19,17,15,8,13,6,12,4)) +
geom_errorbar(aes(ymin=Length-se, ymax=Length+se, colour=Genotype), width=.2) +
guides(colour=FALSE, shape=FALSE) +
facet_wrap(~Genotype, ncol=4)
此图的结果:
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句