1
I’m making some graphs using R, and I need to make a highlight (shaded area in a given location), but I can only plot. Follow the image I can generate:
The highlight has to be a rectangle that goes from the Y axis from 4 to 50 and the X axis from 21 May to 31 May. Follows the code:
library(openair)
library(latticeExtra)
library(grid)
library(lubridate)
timePlot(mydata, pollutant = c("Nox"), ylab = "Concentração", xlab = "Período de estudo", smooth=TRUE, cols = c("black"))
trellis.last.object()+
layer(lpolygon(x = c(ymd("2018-05-21"), ymd("2018-05-21"), ymd("2018-05-30"), ymd("2018-05-30")), y = c(-20, 600, 600, -20), col = "blue", border = NA, alpha = 0.2), under = TRUE, rows = 5)
If anyone knows, I’ll thank you! Follow the document I’m using in CSV.
Unfortunately, this question cannot be reproduced by anyone trying to answer it. Please, take a look at this link and see how to ask a reproducible question in R. So, people who wish to help you will be able to do this in the best possible way.
– Marcus Nunes