r - Geom_segment 没有读取缺失的美学:x、y、xend 和yend Piper Plot
问题描述
我试图在这里重现 Piper 图:https ://github.com/markolipka/ggplot_Piper但是我不断收到错误消息:
错误:geom_segment 需要以下缺失的美学:x、y、xend 和yend,
尽管 x、y、xend并在代码中指定了yend:
https ://pastebin.pl/view/3a5dfd01
有没有人使用过这个 Piperplot 代码?谁能指出我需要删除或添加的正确方向?
解决方案
没有可重复的例子很难说。
尝试以下操作:
b <- ggplot(mtcars, aes(wt, mpg)) +
geom_point()
df <- data.frame(x1 = 2.62, x2 = 3.57, y1 = 21.0, y2 = 15.0)
b +
geom_curve(aes(x = x1, y = y1, xend = x2, yend = y2, colour = "curve"), data = df) +
geom_segment(aes(x = x1, y = y1, xend = x2, yend = y2, colour = "segment"), data = df)
如果它有效,那么我敢打赌你的数据框有问题。可能是您的变量不存在或格式错误。它不起作用,那么您可能必须再次安装 ggplot。
推荐阅读
- excel - Date Format for Macro
- python - SGD optimiser graph
- ruby - 在 Ruby 中执行一个 shell 脚本,将 HTML/PHP 代码作为参数传递
- ruby-on-rails - Rails:季度自动化失败且没有错误
- mysql - 在 2 个不同的表格中选择信息
- c - 你如何使用 Xcode 在 C 上显示扩展的 ascii 表?
- kubernetes - 无法在 Kubernetes 中访问绑定 dns
- c# - 是否有与 .NET Core 的 IControllerActivator 等效的 .NET Framework?
- python-3.x - python3非阻塞fifo打开
- amazon-web-services - AWS 无法识别的 Lambda 输出 Cognito 错误