geom_area产生水平线,区域填充应为

时间:2018-09-25 13:01:37

标签: r ggplot2

我正在尝试使用geom_area填充分隔线上方和下方的区域。但是,一旦使用了代码,这些奇怪的水平线就会出现在图形线下方,并且该区域没有被填充。此外,geom_ribbon也未显示在图表上。

这是我的代码:

ggplot(my_data, aes(x = Concentration, y = OD600_avg)) +
  geom_area(colour = "black", fill = "blue", alpha = 0.2) +
  geom_ribbon(aes(x = Concentration, ymin = OD600_avg - OD600_sdv, ymax = OD600_avg + OD600_sdv), fill = "firebrick", alpha = 0.4) +
  geom_line(colour = "red", size = 1, aes(x = Concentration, y = OD600_avg, group = 1))

数据:

my_data <- data.frame("Concentration" = c("0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55"), 
                   "OD600_avg" = c("0.8", "0.17", "0.15", "0.14", "0.137", "0.12", "0.11", "0.09", "0.08", "0.08", "0.08", "0.08"),
                   "OD600_sdv" = c("0.05", "0.004", "0.002", "0.005", "0.008", "0.005", "0.007", "0.02", "0.011", "0.02", "0.004", "0.004"))

这是结果:

Result of ggplot

有人知道为什么会这样吗?

1 个答案:

答案 0 :(得分:1)

您的数据不是function Something_Change(cikkszamid,cikkid,kiszereles,me) { var input_field = document.getElementById(cikkszamid); var imgchanges = document.getElementById(cikkid); imgchange.src = '<?php echo url::base().'media/images/shopping_cart.png' ?>'; imgchange.setAttribute("width", "24"); imgchange.setAttribute("height", "24"); imgchange.style.cursor = "pointer"; imgchange.onclick = Another_Something_Change(cikkszamid,cikkid,kiszereles,me); input_field.disabled = false; input_field.style.color = "red"; input_field.style.borderColor = "red"; input_field.style.borderWidth = "2px"; } ,而是numeric。以下作品

characters

enter image description here