2017-07-20 75 views
0

字體的大小增加我想提出一個情節,像這樣:上傳說

library(raster) 

r <- raster(volcano) 
r2 <- raster(volcano) 
r3 <- raster(volcano) 
r4 <- raster(volcano) 

opar = par(mfrow=c(2, 2), mar = c(0,0,2,0), oma = c(0,0,0,0)) 
asp = 0.8 

print (plot(r, axes=F, legend=F, box=F, useRaster=F,asp = asp)) 
title(main = 'Time Series', line = 0.6, adj = 0.45) 

print (plot(r2, axes=F, legend=F, box=F, useRaster=F,asp = asp)) 
title(main = 'Early Season', line = 0.6, adj = 0.45) 

print (plot(r3, axes=F,legend=F, box=F, useRaster=F,asp = asp)) 
title(main = 'Peak Summer', line = 0.6, adj = 0.45) 

print (plot(r4,legend=F, box=F, useRaster=F,asp = asp)) 
title(main = 'Late Season', line = 0.6, adj = 0.45) 
print (plot(r, legend.only=TRUE, legend.width = 1, legend.shrink=0.75, smallplot = c(0.85,0.90, 0.04, 0.63), legend.args= list(text='Slope', side=2, font=3, line = 0.2, cex=2))) 

,我想增加字體的大小在圖例中。在上面,cex = 2增加或減少「斜率」的大小,但我想增加數字的大小,這些數字代表了繪圖本身的值。

我的輸出是:

enter image description here

+0

你能提供一個可重複的例子嗎? –

回答

1

cex.axis應該工作。這是一個可重複的例子:

library(raster) 
    r <- raster(nrows=10, ncols=10) 
    r <- setValues(r, 1:ncell(r)) 

opar = par(mfrow=c(2, 1), mar = c(0,0,2.5, 0)) 
    plot(r, legend.width = 1, legend.shrink=0.75, axis.args=list(cex.axis=2), legend.args=list(text='Slope', side=2)) 
    plot(r, legend.width = 1, legend.shrink=0.75, axis.args=list(cex.axis=0.5), legend.args=list(text='Slope', side=2)) 

enter image description here