R语言,raster包barplot函数,简单展示高程统计

# Wed Sep 09 15:50:24 2020 -

# 字符编码:UTF-8
# R 版本:R x64 4.0.2
# cgh163email@163.com
#个人笔记不负责任 
# —— 拎了个梨🍐
rm(list=ls());gc()
.rs.restartR()

require(raster)
# Wed Sep 09 15:29:09 2020 --barplot函数,RasterLayer的条形图----------------------------
# 创建一个RasterLayer值的条形图。 对于大型数据集,使用大小约为maxpixels的常规样本。

f <- system.file("external/test.grd", package="raster")
r <- raster(f)
par(mfrow=c(1,2)) # 一页多图
barplot(r, digits=-2, las=2, ylab='Frequency')

op <- par(no.readonly = TRUE)
par(mai = c(1, 2, .5, .5))
barplot(r, breaks=10, col=c('red', 'blue'), horiz=TRUE, digits=NULL, las=1)
par(op)
# Wed Sep 09 15:50:38 2020 -DIY-----------------------------

rm(list=ls());gc()
map.yuexiushan <- raster('越秀山50米采样grd高程.grd')
map.yuexiushan

barplot(map.yuexiushan) #  竖排
barplot(map.yuexiushan,digits = 0, #  四舍五入精确度
        ,breaks = 14 #  总共分成5份
        ,col = rainbow(14) # 彩虹调色板,5种颜色
        ,     las = 2)
# 横排:
barplot(map.yuexiushan
        ,breaks = 10
        ,col = c('red','green','pink')
        ,horiz = TRUE
        ,digits = 0
        ,las = 1
        )
# Wed Sep 09 16:45:03 2020 -
par(mfrow = c(1,2))
plot(map.yuexiushan)
barplot(map.yuexiushan)
text(x = 32,y = 33,labels = '越秀山高程展示及简单统计')

# End
一般展示
预览

横排展示
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。