0

ここに画像の説明を入力

カラーブレーク、カラーバーの位置をすべて colorkey 引数内で定義したいと思います。私は以下を使用してみました:

library(raster)
library(rasterVis)

p.at =seq( 1.160766  ,3.554995 ,length.out = 17)# I have 16 colors breaks
p.at=round(p.at,digits = 1)# min and max of all datasets
#Moreover, if you want to define where the labels are located define the components of colorkey:
Labels<-list(at=p.at)
Colorkey <- list(at=at,labels=Labels)## where the colors change   ## where to print labels
themes <- rasterTheme(region=brewer.pal(11,'RdYlBu'))

s <- stack(Precip_JJA,Precip_JJAsim)# two datasets
#x.scale=list(cex=1, alternating=1, col='black')
#y.scale=list(cex=1, alternating=1, col='black')
#scales=list(x=x.scale, y=y.scale)
Precip_plot<-levelplot(s, layout=c(2, 1), index.cond=list(c(1, 2)),par.settings=themes,scales=list(x=list(draw=FALSE)),  
                    margin=FALSE,xlab=NULL,par.strip.text=list(cex=0),
                    colorkey = list(space = "bottom",labels = list(cex=1,at = p.at),lab = p.at))

Precip_plot

問題: ラベルがカラー ブレークと正確に一致しません。上の画像を参照してください。私のコードに何か問題がありますか?

どうもありがとう、aez。

4

0 に答える 0