【发布时间】:2021-11-13 08:47:23
【问题描述】:
我正在为人道主义目的制作传单地图,因此我需要将 OCHA 图标用于我地图上的对象。但我找不到将 OCHA 图标插入 R 环境的任何库。任何解决方案? 谢谢
【问题讨论】:
标签: r dictionary leaflet icons interactive
我正在为人道主义目的制作传单地图,因此我需要将 OCHA 图标用于我地图上的对象。但我找不到将 OCHA 图标插入 R 环境的任何库。任何解决方案? 谢谢
【问题讨论】:
标签: r dictionary leaflet icons interactive
看我的例子
library(png)
library(grid)
library(tidyverse)
g1 = readPNG("icons/Advocacy.png") %>% rasterGrob(interpolate=TRUE)
g2 = readPNG("icons/Add-document.png") %>% rasterGrob(interpolate=TRUE)
mi_counties <- map_data("county", "michigan") %>%
select(lon = long, lat, group, id = subregion)
ggplot(mi_counties, aes(lon, lat)) +
geom_point(size = .25, show.legend = FALSE) +
annotation_custom(g1, xmin=-88, xmax=-88.5, ymin=45, ymax=45.5)+
annotation_custom(g2, xmin=-84, xmax=-84.5, ymin=42, ymax=42.5)
我以 png 格式保存了 OCHA 图标。 svg 格式有问题。
【讨论】: