r - 注释矩形以在两个因素之间开始
问题描述
这是我的例子,从这个问题获得:
ex <- data.frame(a = factor(letters[1:10]),
b = factor(rep(c('b', 'a'), 5)),
c = rep(letters[1:5], 2))
ex$a <- factor(ex$a, levels = ex$a[order(ex$b)])
当ggploting...
library(ggplot2)
ggplot(data = ex, aes(y = a, x = c)) +
geom_point() +
annotate(xmin = 'b', xmax = 'd', ymin = -Inf, ymax = Inf, geom = 'rect', alpha = 0.2)
但是,灰色矩形如何在 和 之间开始 a
并 在** 和之间b
结束 ?d
e
解决方案
推荐阅读
- r - Problem with assign df$COLUMN[x] = df2$COLUMN[y] in R
- influxdb - 一个 influxdb,两个数据库在不同的目录
- ruby-on-rails - 如何使用 ruby 从 json 中删除多个属性
- ios - 如何使用 Swift 4 将字符串拆分为英语和非英语?
- c# - 从 C# 中的 DataGridView 更新 SQL 中的数据问题
- c# - 如何在使用@keyup 时从我的代码隐藏中的输入中获取值
- angular - Angular 6 弹出窗口
- parsing - Haskell Parsec:感人的运算符
- postgresql - JPA 错误 QuerySyntaxException:播放器未映射 [SELECT p FROM Player p]
- wordpress - Wordpress 缩放全尺寸图像而不是提供缩略图