r - 为什么 ggplot2 会根据 coord_map 的 xlim 生成地图偏移量?
问题描述
有人可以解释一下,为什么 ggplot 在地图中产生偏移?我在地图 A 和 B 的两个代码中唯一更改的是 xlim。如果我需要地图 A 范围的地图,我不明白为什么会产生此错误也无法解决此问题。感谢您的帮助和时间。
world <- rworldmap::getMap(resolution = "low")
fty_world <- ggplot2::fortify( world)
## map A with offset in the image
ggplot() +
geom_polygon( data = fty_world,
aes( x = long,
y = lat,
group = group),
fill = "white",
color = "grey50") +
coord_map( xlim = c( -3, 14),
ylim = c( 43, 54))
## map B without offset
ggplot() +
geom_polygon( data = fty_world,
aes( x = long,
y = lat,
group = group),
fill = "white",
color = "grey50") +
coord_map( xlim = c( -2, 14),
ylim = c( 43, 54))
解决方案
推荐阅读
- node.js - smb2 在删除文件时出现访问被拒绝错误
- powerbi - 在 Microsoft Bot Framework 与 powerBI 集成中增加数据节省时间
- android - Flutter 签名密钥已更改:您的 Android App Bundle 使用错误的密钥签名。确保您的 App Bundle 使用正确的签名密钥进行签名
- django - 在 Django Admin 中构建内联表单集
- reactjs - 找不到 react-redux 上下文值;请确保组件被包裹在一个
即使已经包含在提供程序中 - c# - 从外面退出一个方法,这可能吗?
- database - 如何使 Postgres 容器与亚马逊 EFS 共享数据?
- javascript - TypeError:无法读取 covid 跟踪器应用程序中未定义错误的属性“地图”
- excel - 使用带有 VBA 的 gmail 和我的工作办公室域发送电子邮件
- node.js - CastError:模型的路径“_id”处的值“:id”转换为 ObjectId 失败