Description Usage Arguments Details Value Author(s) See Also Examples
Allows to plot multiple time series with different y-axes into one plot. This function is an alternative approach to plot trends than plot.Trend
. It is especially suited to plot trends of different variables with different units in one figure.
1 2 3 4 5 6 7 8 9 10 11 |
x |
time series that should be plotted. If |
xlim |
range of x-axis |
rge |
range of y-axis in which the time series should be plotted. |
ylim |
|
col |
color of the time series and corresponding |
lwd |
line width of the time series |
add |
initialize a new plot if FALSE or adds time series to existing plot if TRUE |
axis |
draws a y-axis if TRUE |
ylab |
label for y-axis |
axis.pos |
position of y-axis: l (left) or r (right) |
axis.col |
color for the |
axis.lim |
limits (min/max) for the |
trend |
compute and adds a |
trend.period |
define a sub-period (e.g. c(1990, 2015)) to compute trends for the full time series and this period |
trend.text |
type of |
unit |
|
text |
additional |
unc |
if |
ensfun |
if |
... |
further arguments to |
This function plots a scatterplot.
A list with information about the estimated trend
.
Matthias Forkel <matthias.forkel@tu-dresden.de> [aut, cre]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | ndvi <- aggregate(ndvi, FUN=mean)
# default plot
MtsPlot(ndvi, ylab="NDVI")
MtsPlot(ndvi, ylab="NDVI", text="GIMMS")
MtsPlot(ndvi, rge=c(0.4, 1)) # plot time series in (0.4-1) range of y-axis
MtsPlot(ndvi, rge=c(0.5, 1), ylim=c(0,1)) # use (0-1) range for y-values and
# plot in (0.5-1) range of y-axis
# plot with uncertainty ranges
ndvi2 <- cbind(ndvi, ndvi * 1.3, ndvi * 0.7)
MtsPlot(ndvi2, rge=c(0.5, 1)) # uncertainty as polygon
MtsPlot(ndvi2, add=TRUE, rge=c(0, 0.5), unc="line", col="red",
axis.pos="r") # uncertainty as line
# # plot multiple time series
# ndvi2 <- ndvi * 2 # scaled NDVI
# ndvi3 <- ndvi^2 # squared NDVI
# par(mar=c(3, 3, 2, 3))
# MtsPlot(ndvi, rge=c(0.66, 1), ylab="NDVI")
# MtsPlot(ndvi2, add=TRUE, rge=c(0.33, 0.66), axis.pos="r", ylab="NDVI*2", col="red")
# MtsPlot(ndvi3, add=TRUE, rge=c(0, 0.33), axis.pos="l", ylab="NDVI^2", col="purple")
#
# # options for trend
# MtsPlot(ndvi, ylab="NDVI", trend=NULL) # no trend
# MtsPlot(ndvi, ylab="NDVI", trend.period=c(1982, 1996)) # compute trend in subperiod
# MtsPlot(ndvi, ylab="NDVI", trend.period=c(1982, 1996),
# unit="NDVI", trend.text=1) # text: trend in % (default)
# MtsPlot(ndvi, ylab="NDVI", trend.period=c(1982, 1996),
# unit="NDVI", trend.text=2) # text: trend in units
# MtsPlot(ndvi, ylab="NDVI", trend.period=c(1982, 1996),
# unit="NDVI", trend.text=3) # text: trend without unit
# MtsPlot(ndvi, ylab="NDVI", trend.period=c(1982, 1996),
# unit="NDVI", trend.text=4) # text: p-value only
#
# ndvi2 <- cbind(ndvi, ndvi * 1.3, ndvi * 0.7)
# MtsPlot(ndvi2, ylab="NDVI", trend.period=c(1982, 1996),
# unit="NDVI", trend.text=5) # text: p-value only
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.