Skip to content
Christian Zang edited this page Jul 30, 2014 · 4 revisions

treeclim uses ggplot2 to produce its graphical output. To plot the output from a calibration run is straight forward:

data(muc_spruce)
data(muc_clim)
my_dc <- dcc(muc_spruce, muc_clim)
plot(my_dc)

The same is true for the moving case:

my_dc <- dcc(muc_spruce, muc_clim, moving = TRUE, win_size = 40)
plot(my_dc)

Calling plot on the output of dcc does not actually draw the plot directly, but rather returns on object of class gg, whose print method results in drawing the plot. This means that the plot object for a dcc result can be treated further using ggplot2 functionality:

library(ggplot2)
my_dc <- dcc(muc_spruce, muc_clim)
plot(my_dc) + theme(legend.position = "left")

This will place the legend on the left side of the plot, while this

plot(my_dc) + labs(title = "My DC")

will add a title to the plot.

Clone this wiki locally