plotmag {wsyn} | R Documentation |
For plotting the magnitude of values in tts
, coh
and wlmtest
objects
Description
For plotting the magnitude of values in tts
objects (and derived classes)
against time and timescale, and coh
and wlmtest
objects against timescale
Usage
plotmag(object, ...)
## S3 method for class 'tts'
plotmag(
object,
zlims = NULL,
neat = TRUE,
colorfill = NULL,
colorbar = TRUE,
title = NULL,
filename = NA,
...
)
## S3 method for class 'wt'
plotmag(
object,
zlims = NULL,
neat = TRUE,
colorfill = NULL,
colorbar = TRUE,
title = NULL,
filename = NA,
...
)
## S3 method for class 'wmf'
plotmag(
object,
zlims = NULL,
neat = TRUE,
colorfill = NULL,
colorbar = TRUE,
title = NULL,
filename = NA,
...
)
## S3 method for class 'wpmf'
plotmag(
object,
zlims = NULL,
neat = TRUE,
colorfill = NULL,
sigthresh = 0.95,
colorbar = TRUE,
title = NULL,
filename = NA,
...
)
## S3 method for class 'coh'
plotmag(
object,
sigthresh = c(0.95, 0.99),
bandprows = "all",
filename = NA,
...
)
## S3 method for class 'wlmtest'
plotmag(
object,
sigthresh = c(0.95, 0.99),
bandprows = "all",
filename = NA,
...
)
## Default S3 method:
plotmag(object, ...)
Arguments
object |
An object of class |
... |
Additional graphics parameters passed to |
zlims |
z axis limits. If specified, must encompass the range of
|
neat |
Logical. Should timescales with no values be trimmed? |
colorfill |
Color spectrum to use, set through colorRampPalette. Default value NULL produces jet colors from Matlab. |
colorbar |
Logical. Should a colorbar legend be plotted? |
title |
Title for the top of the plot. |
filename |
Filename (without extension), for saving as pdf. Default value NA saves no file and uses the default graphics device. |
sigthresh |
Significance threshold(s). Numeric vector with values between 0 and 1.
Typically 0.95, 0.99, 0.999, etc. For |
bandprows |
The rows of |
Details
For coh
(respectively, wlmtest
) objects, the modulus of
object$coher (respectively, object$wlmobj$coher) is plotted using a solid red line, and
the modulus of object$signif$coher is plotted using a dashed red line. The two coherences
agree except for sigmethod="fast"
, for which they are close. The dashed line is what
should be compared to the distribution of surrogate coherences (black lines, which only appear
for coh
objects if signif
is not NA
). Horizontal axis ticks are labeled
as timescales, but are spaced on the axis as log(1/timescale), i.e., log frequencies.
Author(s)
Thomas Anderson, anderstl@gmail.com, Jon Walter, jaw3es@virginia.edu; Lawrence Sheppard, lwsheppard@ku.edu; Daniel Reuman, reuman@ku.edu
References
Sheppard, L.W., et al. (2016) Changes in large-scale climate alter spatial synchrony of aphid pests. Nature Climate Change. DOI: 10.1038/nclimate2881
Sheppard, LW et al. (2019) Synchrony is more than its top-down and climatic parts: interacting Moran effects on phytoplankton in British seas. Plos Computational Biology 15, e1006744. doi: 10.1371/journal.pcbi.1006744
See Also
tts
, wt
, wmf
, wpmf
, coh
,
wlmtest
, plotphase
, bandtest
, plotrank
,
browseVignettes("wsyn")
Examples
#For a wt object
time1<-1:100
time2<-101:200
ts1p1<-sin(2*pi*time1/15)
ts1p2<-0*time1
ts2p1<-0*time2
ts2p2<-sin(2*pi*time2/8)
ts1<-ts1p1+ts1p2
ts2<-ts2p1+ts2p2
ts<-c(ts1,ts2)
ra<-rnorm(200,mean=0,sd=0.5)
t.series<-ts+ra
t.series<-t.series-mean(t.series)
times<-c(time1,time2)
res<-wt(t.series, times)
plotmag(res)
#For a wmf object
x1<-0:50
x2<-51:100
x<-c(x1,x2)
ts1<-c(sin(2*pi*x1/10),sin(2*pi*x2/5))+1.1
dat<-matrix(NA,11,length(x))
for (counter in 1:dim(dat)[1])
{
ts2<-3*sin(2*pi*x/3+2*pi*runif(1))+3.1
ts3<-rnorm(length(x),0,1.5)
dat[counter,]<-ts1+ts2+ts3
dat[counter,]<-dat[counter,]-mean(dat[counter,])
}
times<-x
res<-wmf(dat,times)
plotmag(res)
#similar calls for wpmf, coh, wlm, wlmtest objects
#see documentation