答案 0 :(得分:0)
我尝试了ggplot2方法,但出现了错误(FUN(X [[i]],...)中的错误:找不到对象'to.lon')。
ggplot(chicken_QH,
aes(x = from.lon, y = from.lat, xend = to.lon, yend = to.lat)) +
geom_edges(aes(size = chickenBatchs/10000,
alpha = chickenBatchs/10000,
color = type),
curvature = 0.3,
arrow = arrow(length = unit(10, "pt"),
type = "closed")) +
geom_nodes(color = "gold", size = 10, alpha = .5) +
geom_nodes(color = "gold", size = 3) +
geom_nodetext(aes(label = from), fontface = "bold") +
scale_linetype_discrete(guide = F) +
geom_polygon(data = china_blank,
aes(x = long, y = lat, group = group),
fill = "white",
col = "grey",
size = rel(.3)) +
coord_quickmap()
也可以使用基本绘图方法,尽管它确实可以工作,但是它的位置很简单。
map(china_blank, asp = 1)
plot(dg_cattle_QH,
edge.color = adjustcolor(qc, alpha.f = .7),
edge.curved = 0.2,
edge.width = qw,
vertex.size = 6,
vertex.color = adjustcolor("gold", alpha.f = .7),
layout = as.matrix(xy_province_capital_ch[, 3:4]),
add = TRUE,
rescale = FALSE)