- 已编辑
xx <- seq(1:12)
yy_1 <- 2.4310522 / (1 + exp(2.9500379 - xx) / 0.7346499)
yy_2 <- 3.0789415 / (1 + exp(3.1014717 - xx) / 0.7414208)
log_data_1 <- cbind.data.frame(xx, yy_1, yy_2)
library(ggplot2)
ggplot() +
geom_line(data = log_data_1, aes(x = xx, y = yy_1), colour = "green", linetype = 2, size = 1.1) +
geom_point(data = log_data_1, aes(x = xx, y = yy_1), size = 1.4) +
geom_line(data = log_data_1, aes(x = xx, y = yy_2), colour = "red", size = 1.1) +
geom_point(data = log_data_1, aes(x = xx, y = yy_2), size = 1.4) +
scale_x_continuous(name = "Age ( month )", limits = c(1, 12), breaks = seq(1, 12, 1)) +
scale_y_continuous(name = " Wet weight ( g )", limits = c(0, 3.5), breaks = seq(0, 3.5, 0.5))
请教下大家,为什么这个画图没有生成图例呢?排错了好久,没找到原因