oce.plot.ts(x, y, type="l", xlim, ylim, xlab, ylab,
drawTimeRange=getOption("oceDrawTimeRange"), adorn=NULL, fill=FALSE,
xaxs=par("xaxs"), yaxs=par("yaxs"),
cex=par("cex"), cex.axis=par("cex.axis"), cex.main=par("cex.main"),
mgp=getOption("oceMgp"),
mar=c(mgp[1]+if(nchar(xlab)>0) 1.5 else 1, mgp[1]+1.5, mgp[2]+1, mgp[2]+3/4),
main="",
despike=FALSE,
axes=TRUE, tformat,
marginsAsImage=FALSE,
grid=FALSE, grid.col="darkgray", grid.lty="dotted", grid.lwd=1,
debug=getOption("oceDebug"),
...)
"l"
for lines, "p"
for points.TRUE
to indicate the range of
times in the top-left margin.expression
to be performed immediately
after drawing the panel. (See plot.adp
for an example.)TRUE
to fill the curve to zero (which it does
incorrectly if there are missing values in y
).""
.par("xaxs")
.par("yaxs")
.par
("cex").par
("cex.axis").par
("cex.main").par(mgp)
, and also for
par(mar)
, computed from this. The default is tighter than the R
default, in order to use more space for the data and less for the axes.par("mar")
to set margins. THe
default value uses significantly tighter margins than is the norm in R,
which gives more space for the data. However, in doing this, the existing
despike
.TRUE
to get axes plottedimagep
.TRUE
, a grid will be drawn for each panel. (This
argument is needed, because calling grid
after doing a
sequence of plots will not result in useful results for the individual
panelplot
.xat
and yat
,
values that can be used by oce.grid
to add a grid to the
plot.plot
and
plot.ts
routines will not obey the time zone of the
data. This routine gets around that problem. It can also plot the
time range in the top-left margin, if desired; this string includes
the timezone, to remove any possible confusion.The time axis is drawn with oce.axis.POSIXct
.
library(oce)
t0 <- as.POSIXct("2008-01-01", tz="UTC")
t <- seq(t0, length.out=48, by="30 min")
y <- sin(as.numeric(t - t0) * 2 * pi / (12 * 3600))
oce.plot.ts(t, y, type='l', xaxs='i')
Run the code above in your browser using DataLab