Wavelet Coherence



I am working with monthly data and trying to use the wavelet coherence to find correlations between two series. I have used the following codes by Ibn Abdullah.

Please find below the code I am using

t1 = cbind(Date, CL)
t2 = cbind(Date, Local)

wtc.AB = wtc(t1, t2, nrands = nrands

This part runs fine but the main problem is the wavelet coherence plot, I use this code

par(oma = c(0, 0, 0, 1), mar = c(5, 4, 7, 8) + 0.5)
plot(wtc.AB, plot.phase = TRUE, lty.coi = 1, col.coi = "grey", lwd.coi = 2,
lwd.sig = 3, arrow.lwd = 0.02, arrow.len = 0.06, ylab = "Scale", xlab = "Period",
plot.cb = TRUE, main ="Title")
n = length(A)
abline(v = seq(324, n, 324), h = 1:26, col = "brown", lty = 1, lwd = 1)

What I would like is to be able to label the x-axis with the years and then the y-axis with the month.

Can anyone advise?

Thank you


Could you please turn this into a self-contained reprex (short for minimal reproducible example)? It will help us help you if we can be sure we're all working with/looking at the same stuff.

Right now the best way to install reprex is:

# install.packages("devtools")

If you've never heard of a reprex before, you might want to start by reading the tidyverse.org help page. The reprex dos and don'ts are also useful.

If you run into problems with access to your clipboard, you can specify an outfile for the reprex, and then copy and paste the contents into the forum.

reprex::reprex(input = "fruits_stringdist.R", outfile = "fruits_stringdist.md")

For pointers specific to the community site, check out the reprex FAQ, linked to below.