Rev 46 | Blame | Compare with Previous | Last modification | View Log | RSS feed
## PD 20110923: This functionality is in bdsharex.start, bdsharex.end
## PB 20101110: For plotting many plots with one x-axis.
## Split this into two function, e.g. plotOneXAxisBegin og plotOneXAxisEnd.
##------------------------------------------------------------------------
## The number of plots in the figure
n <-
## Make the figure layout
## The first element to heights is the upper "margin", the last is the lower "margin"
layout(1:(n+2), heights=c(lcm(0.1), rep(1,n), lcm(1)))
## Set par. Note xaxt="n" here, and in the last plot xaxt="s"
par(mar=c(0,3,0,1), xaxt="n", mgp=c(2,0.7,0))
## The top margin plot is empty.
plot(0, type="n", xaxt="n", yaxt="n", bty="n", xlab="", ylab="")
## Do n plots of what you want, make xlab=""
plot(D$t, D$x, xlab="", ylab="x (kW)")
...
##------------------------------------------------------------------------
## The last plot to fill the lower "margin"
plot(D$t, D$y, xaxt="s", xlab="Time", ylab="y (C)")
## xlab text
mtext("Time", 1, line=2, cex=par("cex"))