sp對象
sp對象2
柵格對象
比例設(shè)置不好搞
# Thu Sep 24 14:49:46 2020 -
# 字符編碼:UTF-8
# R 版本:R x64 4.0.2
# cgh163email@163.com
#個人筆記不負責任
# —— 拎了個梨??
.rs.restartR()
rm(list=ls());gc()
require(raster)
# Thu Sep 24 14:49:48 2020 ---scalebar標尺---------------------------
f <- system.file("external/test.grd", package="raster")
r <- raster(f)
plot(r)
scalebar(1000)
scalebar(1000, xy=c(178000, 333500), type='bar', divs=4)
# Thu Sep 24 14:51:49 2020 --diy,sp添加比例尺----------------------------
map.gz <- read.geoShape('https://geo.datav.aliyun.com/areas_v2/bound/440100_full.json')
plot(map.gz,main='sp對象添加比例尺')
map.gz
scalebar(10)
scalebar(100,
xy = click(),
type = 'bar',
below = '文字備注',
lonlat = T,
adj = c(2.5,-2),
# label = c(2,4,3),
lwd = 5,
divs = 4) # 手動放置比例尺
# divs條形類型的分割數(shù)凳兵。 2或4
# xy x和y坐標以放置繪圖百新。 可以為NULL。 使用xy = click()使其互動
# type
# "line" or "bar"
# below
# 文字移至比例尺下方(即“公里”)
# lonlat
# 邏輯或NULL庐扫。 如果符合邏輯饭望,則TRUE表示繪圖是否使用經(jīng)度/緯度坐標。 如果為NULL形庭,則從圖的坐標中猜測
# adj
# 調(diào)整文字位置
# label
# 三個數(shù)字的向量铅辞,用于標記比例尺(起點,中點萨醒,終點)
# lwd
# “線”型比例尺的線寬