2016-05-26 6 views
0

4列5行に20個のグラフで構成されるプロットに5つのサブタイトルを設定する方法はありますか?複数のチャートプロットの行ごとの相対タイトルを設定

グラフの図を添付しました。

タイトルを次のように挿入しようとしましたが、出力プロットを調整するとタイトルが移動します。

mtext("Frankfurt (Forecast 2012 - 2033)", side = 3, line = -1.5, outer = TRUE) 

私はコードの次の数行が見つかりましたが、それらは唯一の20個のグラフの一つに関連しているように見える、全体ではなく、プロット

op <- par("usr") 
par(usr = c(0, 1, 0, 1)) 
text(0.5,0.5,"TEST") 
par(usr = op) 

http://i.imgur.com/j0AfMxE.png?1

+0

再現可能なサンプルのサンプルデータを提供できますか? –

答えて

0

これは私のアプローチです。

mat <- matrix(c(rep(1,4), 6:9, rep(2,4), 10:13, rep(3,4), 14:17, rep(4,4), 18:21, 
       rep(5,4), 22:25), ncol=4, byrow=T) 
mat     # 1-5: subtitle, 6-: mainplot 
layout(mat, heights=c(rep(c(1, 20), 5))) # heights setting (rough) 

par(mar=c(0,0,0,0)) 
for(i in 1:5) { 
    plot(0, 0, type="n", ann=F, axes=F) # plotting white paper & subtitle 
    mtext(side=1, line=0.2, "subtitle") # do it five times 
} 

par(mar=c(2, 2, 2.7, 1), mgp=c(3, 0.6, 0)) # margins and tick lab position set 
for(i in 1:20) { 
    plot(rnorm(30), ann=F)   # main plot 
    title(LETTERS[i], line=0.3)  # each title (don't use plot(main=)) 
} 
関連する問題