2016-06-22 39 views
0

我正在与rasterVishorizonplot功能,我想改变区间间隔;例如我想要显示x axis中每10个纬度区域的平均值。这是an examplerasterVis库。更改区域间隔rasterVis horizo​​nplot

library(raster) 
library(rasterVis) 
horizonplot(SSTanom, col.regions = rev(brewer.pal(n = 10, 'RdBu'))) 

回答

1

的区由zonal函数确定,也就是经由digits参数间接入店(整数,位数保持)。采用这种方法,您无法完全控制间隔的数量。例如:

horizonplot(SSTanom, digits = -1) 

horizonplot and digits

另一种解决方案是horizonplotdirXY参数,它提供了更多的灵活性。例如:

horizonplot(SSTanom, dirXY = cut(y, 10)) 

horizonplot and cut

不幸的是,cut不保留的间隔(因为Raster不能存储字符)的标签,所以每个面板的名称没有直接关系到该区域。

+0

完美,谢谢你的回答! –