- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在生成效果大小和相关置信区间的数字,例如:
使用 ggplot2 的 geom_pointrange。我希望第二条点线是透明的,但透明度不是相加的(即只是一种纯色,而不是通过点显示为较暗的线)。
我应用自定义颜色:
+ scale_colour_manual(values=c("#66CD0050","#66CD00"))
最佳答案
thelatemail 的评论是针对这个问题的。使用 scale_color_manual
调用定义颜色将生成请求的图像。请参阅下面的示例。
library(ggplot2)
dat <- data.frame(effect_size = c(-0.1, -0.1),
lcl = c(-0.5, -0.2),
ucl = c(0.3, -0.01),
sla = c("SLA1", "SLA2"))
ggplot(dat) +
theme_classic() +
aes(x = sla, y = effect_size, ymin = lcl, ymax = ucl, color = sla) +
geom_pointrange() +
geom_hline(yintercept = 0, linetype = 2) +
scale_color_manual(values = c("SLA1" = "#66CD00",
"SLA2" = "#cfefb0")) +
coord_flip()
packageVersion("ggplot2")
# [1] ‘2.2.1.9000’
关于删除 ggplot2 geom_pointrange 中的附加透明度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18777278/
我正在生成效果大小和相关置信区间的数字,例如: 使用 ggplot2 的 geom_pointrange。我希望第二条点线是透明的,但透明度不是相加的(即只是一种纯色,而不是通过点显示为较暗的线)。
我修改了我在此 Google 群组帖子中找到的代码:"Annotations to display significant differences"最初由“Tom W”撰写 此代码生成以下点范围图:
我正在尝试使用 ggplot、geom_poitrange 绘制图形。我有两组,每组有两个点和相应的错误值。我使用的代码如下: group<-c("A","A","B","B") va
使用 ggplot 的 geom_pointrange() 函数,如何分别改变点的大小和线的粗细? 例子: # make test data df <- data.frame(y=10, ymin=1
我正在尝试生成一个图表,其中包含来自多个国家/地区的相同回归的估计值和置信区间。我使用 dplyr 运行回归的 group_by(country) ,然后我用 broom 将所有结果聚合到一个数据框中
所以我知道解决这个问题的更好方法是使用 stat_summary()函数,但这是为了解决 Hadley 的 R for Data Science 书中提出的一个问题,主要是为了我自己的好奇心。它询问如
我是一名优秀的程序员,十分优秀!