drGeorgeXenakis / FREddyPro

Post-Processing GHG fluxes after calculations using EddyPro from the Full Output File
GNU General Public License v3.0
1 stars 1 forks source link

Use ggplot2 in `plotDiurnal` #7

Open ronnyhdez opened 2 years ago

ronnyhdez commented 2 years ago

Within the FREddyPro project we can run this to check the example plot:

> data(fluxes)
> 
> ## Clean and despike the fluxes
> fluxes=cleanFluxes(fluxes,sdCor=TRUE,sdTimes=3,distCor=TRUE,timesList=3,
+                    thresholdList=list(H=c(-100,1000),LE=c(-100,1000)))    
> 
> ## Create timestamp
> fluxes=createTimestamp(fluxes)
> 
> ## Plot the diurnal patterns
> plotDiurnal(fluxes, xVar="H", hourX="hour",yVar="LE",hourY="hour",
+             median=TRUE,stdev=TRUE,ylim=c(-100,400),lty=c(1,2,3,4),col=c(1,2,3,4),
+             legend=TRUE,legendSide='topleft',legendText=c("sensible heat","latent heat"),
+             lwd=2,ylab="Heat (W/m"^2~")",main="Harwood forest",cex.legend=0.9,
+             horiz.legend=FALSE)
> 
> abline(h=0,lty=2)

image