View source: R/plot_sensorimage_twilight.R
plot_sensorimage_twilight | R Documentation |
Add sunrise and unset to a sensor image
plot_sensorimage_twilight(date, offset, ...)
date |
Date data in POSIXct format, most commonly |
offset |
This parameter determines where the center of the graph is. When |
... |
Any additional parameters taken by graphics::points which the user may want to use to modify the graphic |
a plot
## Not run: data(hoopoe) # Calculate twilights twilights <- GeoLight::twilightCalc(hoopoe$light$date, hoopoe$light$obs, LightThreshold = 2, ask = FALSE) par(mar=c(4,4,4,2),mfrow=c(1,2), oma= c(0,0,0,8)) # Plot daytime in middle plot_sensorimage(hoopoe$acceleration$date, hoopoe$acceleration$act, main = "Day in middle",ploty=FALSE, offset=0, col=c("black",viridis::cividis(90)), cex=1.2, cex.main = 2) #Add sunrises and sunsets plot_sensorimage_twilight(twilights$tFirst, offset=0, col= ifelse(twilights$type == 1, "goldenrod","cornflowerblue"), pch=16, cex=0.5) # Plot nightime in the middle offset=12 plot_sensorimage(hoopoe$acceleration$date, hoopoe$acceleration$act, main = "Night in middle",ploty=TRUE, offset=offset, col=c("black",viridis::cividis(90)), cex=1.2, cex.main = 2) plot_sensorimage_twilight(twilights$tFirst, offset=offset, col= ifelse(twilights$type == 1, "goldenrod","cornflowerblue"), pch=16, cex=0.5) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.