[英]How to insert a scale on a map in R
另一種選擇是使用庫ggspatial
和tidyterra
。
library(ggspatial)
library(tidyterra)
ggplot() +
geom_spatvector(data = mun) +
annotation_scale() + # add scale
annotation_north_arrow(location = "br", which_north = "true") + # add arrow
theme(
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank(),
axis.text.y=element_blank(), #remove y axis labels
axis.ticks.y=element_blank(), #remove y axis ticks
axis.text.x=element_blank(), #remove x axis labels
axis.ticks.x=element_blank() #remove x axis ticks
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.