ggplot2中的x轴和误差条(两行线图)有问题

问题描述 投票:0回答:1

以下数据:enter image description here

我的x轴出现问题,因为它在运行代码时丢失了它的顺序。我希望得到一个从1到14的轴(等级为1 t0 14)。 qazxsw poi

R格式的数据汇总:

enter image description here

看着水平

chlo <- data.frame(Culture=rep(c("Axenix", "Mixed"), each=14),
                   Time=rep(c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14"),2),
                   Growth=c(4246443, 5863739, 10599835, 19379643, 23071353, 26763062,   29143319,   30373889,   32800365,   34080042,   35359719,   36642284,   38629683,   39663824, 4238613,  3983333, 8383333, 11266667, 14600000,   17933333,   23400000,   25866667,   29333333,   32116667,   34900000,   42833333,   50200000,   54200000))

str(chlo)

我也无法添加垂直标准偏差条:

对于前1到14个值(Axenic),相应的sd是:(+& - ):

chlo$Time
1  2  3  4  5  6  7  8  9  10 11 12 13 14 1  2  3  4  5  6  7  8  9  10 11 12 13 14
Levels: 1 10 11 12 13 14 2 3 4 5 6 7 8 9

对于第二组值1到14(混合)值,相应的sd是(+& - ):

249116, 960902, 2712164,    991667, 914799, 843048, 1826696,    2050218, 3457363,   3664220,    3876349,    4410793, 5123502,   5193421
r ggplot2 standard-deviation linegraph
1个回答
0
投票

44621, 980221, 1871719, 332916, 326917, 321455, 4200000, 2013289, 2386071, 2559460, 3207803, 2773686, 2170253, 5102940 是一个连续的措施,应该是数字:

Time

chlo$Time<-as.numeric(chlo$Time) # install.packages("ggplot2") #uncomment and run if you don't have this package library(ggplot2) ggplot(chlo,aes(x=Time,y=Growth, colour=Culture))+ geom_point()+ geom_line()

错误栏问题是一个单独的问题,并且多次被询问,搜索enter image description here函数。

geom_errorbars()

© www.soinside.com 2019 - 2024. All rights reserved.