'overlapPlot_kernel density function_transparent polygons

I'm trying to ass some polygons behind my overlapPlot in which I have the two Kernel Density curves of daily activities of my species. I've tried several ways, most of them by substituting col argument (in bold) by col2rgb or adjustcolor,... but my polygons always cover the ground or, instead, they are not produced. Here my script:

plot

overlapPlot(volo_m$timeRad, volo_f$timeRad, main="", extend = NULL, olapcol= "lightpink", linewidth = c(2, 3),cex.lab=1.75, cex.axis=1.25, ylab="Activity (density)")

add legend

legend('topright', c("Males", "Females"), lty=c(1,2),lwd=c (3,3), col=c(1,4), bty='n')

add polygons

polygon(x=c(c(19,24), rev(c(19,24))), y=c(0,0,0.20,0.20), border=NA, col="gray30")

Thank you in advance for any suggestions, All the best, Gianluca



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source