library(maps)
map(
database = "world", regions = "china",
col = "red4", xlim = c(72, 137), panel.first = grid()
)
February 17, 2023
https://xiangyun.rbind.io/2022/02/draw-china-maps/
library(maps)
map(
database = "world", regions = "china",
col = "red4", xlim = c(72, 137), panel.first = grid()
)
library("mapdata")
map(
database = "china",
col = "red4", xlim = c(72, 137), panel.first = grid()
)#mapdata 中的map 函数,有内置的中国地图
ggplot() +
geom_path(
data = china_map, aes(long, lat, group = group),
color = "#FD9FA4", show.legend = F
) +
coord_map(projection = "mercator")
library(leaflet)
library(leafletCN) # 提供 geojsonMap 函数
dat <- data.frame(name = regionNames("china"), value = runif(34))
# 还有很多其他参数设置,类似 leaflet::leaflet
geojsonMap(dat, mapName = "china", palette = "RdBu", colorMethod = "bin")#install.packages(“leafletCN”)