インドネシアの水の塩分の 4 つの次元 (経度、緯度、深さ、時間) の NetCDF ファイルがあります。ここからデータをダウンロードします: https://onedrive.live.com/redir?resid=6FFDD661570C7D0A%21177
levelplot
(rastesVis
パッケージ )を使用して、同じ範囲 (最小 - 最大) の値で塩分データをプロットしたいと思います。残念ながら、プロットごとに異なる値の範囲が得られます。私のat=seq(20, 35, 2)
プロットで同じ範囲を定義しませんでしたか?
This is my script:
# Note: Work perfectly after update 'rasterVis package'
# import data
sal <- brick('data.nc', level=1, varname = "salinity")
sal[sal == -32767] <- NA
# colorramp
jet.colors <- colorRampPalette(c('#00007F', 'blue', '#007FFF',
'cyan','#7FFF7F', 'yellow', '#FF7F00',
'red', '#7F0000'))
# create levelplot
for (i in 1:5) { # 5 different time in the same depth/level
png = paste0('D:/sal_',i,'.png')
png(png, width=2200, height=2200, res=300)
print(levelplot(subset(sal,i),
col.regions = jet.colors(255),
at=seq(20, 34, 1),
yscale.components=yscale.raster.subticks,
xscale.components=xscale.raster.subticks,
margin=FALSE, ylab='latitude', xlab='longitude',
main='salinity (psu)'))
dev.off()
}