# Wed Sep 09 15:50:24 2020 -
# 字符編碼:UTF-8
# R 版本:R x64 4.0.2
# cgh163email@163.com
#個(gè)人筆記不負(fù)責(zé)任
# —— 拎了個(gè)梨??
rm(list=ls());gc()
.rs.restartR()
require(raster)
# Wed Sep 09 15:29:09 2020 --barplot函數(shù)郁岩,RasterLayer的條形圖----------------------------
# 創(chuàng)建一個(gè)RasterLayer值的條形圖。 對(duì)于大型數(shù)據(jù)集缺狠,使用大小約為maxpixels的常規(guī)樣本问慎。
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) # 彩虹調(diào)色板,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 = '越秀山高程展示及簡(jiǎn)單統(tǒng)計(jì)')
# End
一般展示
預(yù)覽
橫排展示