【发布时间】:2018-12-19 10:48:50
【问题描述】:
我需要在 ggplot2 中按地区比较乌克兰城市。 但它们都以相同的大小绘制。
你能帮帮我吗?
我使用这个代码:
library(ggplot2)
cities <- read.csv("https://raw.githubusercontent.com/savchukidze/maps/master/cities.csv", stringsAsFactors = F)
png("compare_cities.png", height = 3000, width = 2500)
ggplot()+
geom_polygon(data = cities, aes(long, lat, group = group),
color = "black", size = 2.5, fill = "grey", alpha = 1)+
facet_wrap(~city, scales = "free")
dev.off()
【问题讨论】:
标签: r ggplot2 maps coordinates facet-wrap