-
Notifications
You must be signed in to change notification settings - Fork 17
Description
I am a beginner in using package "Biwavelet". In my dataset, a sequence of week(range: 0-665) are used as time variable. Week 0-39 are from 2005, and each year in 2006-17 include 52 or 53 weeks.
- Why are there strong powers in small periods (5-16 weeks)? Why are the maximum power value so big in the legend? In some previous paper I have read he maximum power value just is 1.
- I want to change the labels in X-axis of wavelet power spectrum, and Year will be shown in the X-axis.
- I want to change the labels in Y-axis of wavelet power spectrum, and 13, 26, 52 and 104 will be shown in the Y-axis.
- I also hope to know how to change the labels in the legend.
Please see my syntax as below.
head(wtdata)
Sweek RPDM
1 0
2 0
3 0
4 0
5 0
6 0
wt<-wt(wtdata)
pdf("~/Documents/Pattern project/Data/figureexample.pdf",width=8,height=10)
layout(matrix(1:2,ncol=1),heights = c(1.5,2))
par(oma = c(0, 0, 0, 1), mar = c(5, 4, 4, 5) + 0.1)
plot(wtdata$Sweek, wtdata$RPDM, type = "l", col = "red",xlab="",ylab="",xaxt="n", yaxt="n")
mtext(side = 2, line = 2.5, 'Positive rate')
xlabs<-c(0,40,92,144,196,249,301,353,405,457,509,562,614)
axis(side = 1, at=xlabs,labels=NA)
for(j in 1:13){mtext(year[j],side=1,at=xlabs[j],line=1,cex=0.6)}
plot(wt, plot.cb = TRUE, plot.phase = FALSE,xlab = "Year", ylab = "Period", legend.horiz=FALSE, xaxt="s", yaxt="s")
mtext(side = 1, line = 2.5, 'Year')
mtext(side = 2, line = 2.5, 'Period')
xlabs<-c(0,40,92,144,196,249,301,353,405,457,509,562,614)
year<-c(2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017)
ylabs<-c(13,26,52,104)
axis(side = 1, at=xlabs,labels=NA)
for(j in 1:10){mtext(year[j],side=1,at=xlabs[j],line=1,cex=0.8)}
axis(side = 1, at=xlabs,labels=NA)
axis(side = 2, at=ylabs,labels=NA)
for(j in 1:10){mtext(year[j],side=1,at=xlabs[j],line=1,cex=0.8)}
for(i in 1:4){mtext(ylabs[i],side=1,at=ylabs[i],line=1,cex=0.8)}
dev.off()