1

我试图想象在 6 天的时间段内某种蛋白质的血清浓度变化。我可以很容易地获得我想要的条形图,但是,我试图发表的期刊需要任何类型的图表中包含的单个数据点。

我也可以通过添加 geom_point 图来做到这一点,但是,当我尝试根据数据点来自的蜂窝线(也是必需的)为每个点分配特定形状时,我的点最终会按特定顺序排序.

这是我当前的数字代码:

ggplot(table6, aes(x = Location, y = Ave, fill = Treatment)) +
geom_col(position = "dodge", color = "black", size = 1) +
    facet_wrap(~ Time) +
        scale_fill_brewer(palette = "Oranges") +
geom_point(aes(y = Conc, x = Location), position = position_dodge(0.9)) +
geom_errorbar(aes(ymin = Ave, ymax = Ave+SD), width = .3,
              size = 1.0, position=position_dodge(.9)) +
labs(title = "Concentration of ANG in Media of Complement Treated iRPE", x = "" , y = "ANG conc. (pg)") +
theme_classic() +
theme(axis.text = element_text(size=12),
      plot.title = element_text(hjust = 0.5, size = 18, face = "bold"), 
      strip.text.x = element_text(size = 16, face = "bold"))

现在,当我尝试为各个点分配形状时,会发生以下情况:

ggplot(table6, aes(x = Location, y = Ave, fill = Treatment)) +
geom_col(position = "dodge", color = "black", size = 1) +
facet_wrap(~ Time) +
scale_fill_brewer(palette = "Oranges") +
geom_point(aes(y = Conc, x = Location, shape = Line), position = position_dodge(0.9)) +
geom_errorbar(aes(ymin = Ave, ymax = Ave+SD), width = .3,
              size = 1.0, position=position_dodge(.9)) +
labs(title = "Title", x = "" , y = "ANG conc. (pg)") +
theme_classic() +
theme(axis.text = element_text(size=12),
      plot.title = element_text(hjust = 0.5, size = 18, face = "bold"), 
      strip.text.x = element_text(size = 16, face = "bold"))

4

0 回答 0