如何使用其他数据集将geom_line添加到现有绘图中

时间:2016-03-17 06:38:14

标签: r ggplot2

我需要在现有情节中添加额外的时间序列曲线。

以下是当前情节的代码:

lims <- as.POSIXct(strptime(c("2015-9-2 00:00","2015-9-3 00:00"), format = "%Y-%m-%d %H:%M"), tz="UTC")

ggplot(subset(DF, ID %in% c("A", "B", "C", "D", "E")),
       aes(x = DateTime, y = Temp, group = ID, colour = ID)) +
   geom_point(alpha = 0.4, size = 0.8) +
   scale_x_datetime(limits = lims, breaks = date_breaks("4 hour"),
                    labels = date_format("%m/%d %H:%M")) +
   scale_colour_manual(values = c("green4", "red", "plum", "gold2", "dodgerblue"),
                       breaks = c("A" , "B" , "C" , "D", "E"),
                       labels = c("N", "E", "W", "S", "C")) 

如何将使用其他数据集(geom_line)中的数据的DF_other$Temp添加到现有情节中?

0 个答案:

没有答案