
Last chance! 50% off unlimited learning
Sale ends in
## S3 method for class 'timeSeries':
plot(x, y = NULL, FinCenter = NULL, plot.type =
c("multiple", "single"), format = "auto", at = "auto", widths = 1,
heights = 1, xy.labels, xy.lines, panel = lines, nc, yax.flip =
FALSE, mar.multi = c(0, 5.1, 0, if (yax.flip) 5.1 else 2.1),
oma.multi = c(6, 0, 5, 0), axes = TRUE, ...)
## S3 method for class 'timeSeries':
lines(x, FinCenter = NULL, \dots)
## S3 method for class 'timeSeries':
points(x, FinCenter = NULL, \dots)
timeSeries
.timeSeries
.text()
labels should be used for an
x-y plot, _or_ character, supplying a vector of labels to be
used. The default is to label for up to 150 points, and not
for more.lines
should be drawn for an x-y
plot. Defaults to the value of xy.labels
if that is
logical, otherwise to TRUE
function(x, col, bg, pch, type, ...)
which gives the
action to be carried out in each panel of the display for
plot.type="multiple"
. The default is lines
type="multiple"
. Defaults
to 1 for up to 4 series, otherwise to 2.type="multiple"
.par
settings for plot.type="multiple"
.plot
, plot.default
and par
timeSeries
.## data -
LPP = as.timeSeries(data(LPP2005REC))[1:12, 1:4]
colnames(LPP) <- abbreviate(colnames(LPP), 2)
finCenter(LPP) <- "GMT"
## plot -
plot(LPP[, 1], type = "o", col = "steelblue",
main = "LPP", xlab = "2005", ylab = "Return")
plot(LPP[, 1:2], type = "o", col = "steelblue",
main = "LPP", xlab = "2005", ylab = "Return")
plot(LPP[, 1], LPP[, 2], type = "o", col = "steelblue",
main = "LPP", xlab = "Return 1", ylab = "Return 2")
## plot -
# Example 1 - The wrong way to do it!
LPP = as.timeSeries(data(LPP2005REC))
ZRH = as.timeSeries(LPP[,"SPI"], zone = "Zurich", FinCenter = "Zurich")
NYC = as.timeSeries(LPP[,"LMI"], zone = "NewYork", FinCenter = "NewYork")
finCenter(ZRH)
finCenter(NYC)
plot(ZRH, type = "p", pch = 19, col = "blue")
points(NYC, pch = 19, col = "red")
## plot -
# Example 2 - Convert NYC to Zurich Time
finCenter(ZRH) <- "Zurich"
finCenter(NYC) <- "Zurich"
at = unique(round(time(ZRH)))
plot(ZRH, type = "p", pch = 19, col = "blue", format = "%b %d", at = at,
xlab = paste(ZRH@FinCenter, "local Time"), main = ZRH@FinCenter)
points(NYC, pch = 19, col = "red")
## plot -
# Example 3 - Forced everything to GMT using "FinCenter" argument
finCenter(ZRH) <- "Zurich"
finCenter(NYC) <- "NewYork"
at = unique(round(time(ZRH)))
plot(ZRH, type = "p", pch = 19, col = "blue", format = "%b %d", at = at,
FinCenter = "GMT", xlab = "GMT", main = "ZRH - GMT")
points(NYC, FinCenter = "GMT", pch = 19, col = "red")
Run the code above in your browser using DataLab