I cannot seem to move the legend from the bottom of my graph when using timePlot
from R openair
. Can anyone assist?
Here is my script and some data:
library(openair)
timeozone <- import(npsfiles[2], date="year", date.format = "%Y", header=TRUE, na.strings="NA")
timePlot(timeozone, pollutant = c("BIBEKB", "MACAGO", "MACAHM", "VOYASB"), group = TRUE, ylab = "Ozone (ppbv)", key.columns = 1)
Data:
Year BIBEKB
1990 70.25
1991 59.25
1992 62.5
1993 64.25
1994 76
1995 68.25
1996 78.375
1997 66.25
I have tried:
auto.key = list(space = "right")
space = "right"
key.position = "right"
I have also tried putting the legend specification outside the timePlot line of code, but I am hoping to be able to get it to work with the location specification in the timePlot function. Thanks for any help you can provide:
plot.new()
legend(1, -1, c("BIBEKB","MACAGO","MACAHM", "VOYASB"))