我想使用densityplot创建一个图,该图具有三个数据线,每个图的三个数据彼此重叠。下面是我用来向同一图中添加九行数据的代码。我想要顶部图中的前三行,中间图中的后三行,底部图中的后三行。
densityPlot(DeerBC$radians, xscale = 24, xcenter = "noon", add = FALSE, rug = FALSE, extend = 'lightgrey', n.grid = 100, adjust = 0.2, main = "Deer Density Vs Time", xlab = "Time", ylab = "Density", col='black')
densityPlot(DeerBT$radians, add=TRUE, col='grey')
densityPlot(DeerBF$radians, add=TRUE, col='light grey')
densityPlot(DeerDC$radians, add=TRUE, col='dark green')
densityPlot(DeerDT$radians, add=TRUE, col='green')
densityPlot(DeerDF$radians, add=TRUE, col='light green')
densityPlot(DeerOC$radians, add=TRUE, col='red')
densityPlot(DeerOT$radians, add=TRUE, col='orange')
densityPlot(DeerOF$radians, add=TRUE, col='yellow')
legend ('topright', c("Before-Control","Before-Ontrail",'Before-Offtrail','During-Control','During-Ontrail','During-Offtrail','Open-Control','Open-Ontrail','Open-Offtrail'), lty = 1, col = c('black','grey','light grey','dark green', 'green','light green','red','orange','yellow'), bg = 'white')