I am stuck with the following problem:
I want to display different characteristics of timeseries in one plot (with several subtitles). To align the areas of the diagram and for easy creation, I use ggplot2its function facet_grid.
However, I want to change only one axis label (for example, the upper graph to a percentage).
In addition, I want to change the height sizes of each plot, so that the upper graph is approximately two times larger than the lower.
Many thanks for your help!
Example
require(ggplot2)
#simulate some data
df <- data.frame(date=c(1:1000),
value=cumsum(rnorm(1000)),
volume=abs(rnorm(1000)*10))
#melt for ggplot
df_melt <- melt(df, id=c("date"),measure.vars=c("value","volume"))
#plot
ggplot(df_melt, aes(x=date, y=value)) + geom_line() +
facet_grid(variable~., scales = "free")
which leads to something like this:

David source
share