r - ggbetweenstats中的点颜色
问题描述
有没有办法改变ggbetweenstats中的点颜色?我检查了文档,没有看到可以简单更改点颜色的参数。我尝试了 ggplot2::scale_fill_manual(values = c(purple,darkred,blue)) 但什么也没发生。
已识别出三种颜色,详细代码如下:
ggbetweenstats(
data = box.dat,
x = Class,
y = Pre_NeoAts,
notch = T,
outlier.tagging = F,
messages = FALSE,
mean.color = "black",
mean.size = 3
) + ggplot2::scale_fill_manual(values = c(purple,darkred,blue))
谁能给我一个提示?非常感谢先进!
解决方案
这是更改点颜色的方法。(这是与ggstatsplot 0.0.6
,目前在CRAN
)
ggstatsplot::ggbetweenstats(
data = iris,
x = Species,
y = Sepal.Length,
messages = FALSE,
mean.color = 'black'
) +
ggplot2::scale_color_manual(values = c("#999999", "#E69F00", "#56B4E9"))
此外,您还可以palette
从package
选择更改颜色中指定,而不是手动指定它们:
ggstatsplot::ggbetweenstats(
data = iris,
x = Species,
y = Sepal.Length,
messages = FALSE,
palette = "Royal1",
package = "wesanderson"
)
由reprex 包(v0.2.1)于 2018 年 10 月 10 日创建
推荐阅读
- python-3.x - 如何使用 pandas group by 进行基于逻辑的过滤
- c++ - 在不改变值和性能的情况下多次访问位域?
- terraform - 如何在 Azure 中配置 Terraform
- html - 如何让 ajax 从多个 HTML 类元素中读取数据
- python - Python 3 中的无包装器
- java - 将数据插入表时出现“强制转换的字符值无效”错误。爪哇
- android-studio - 将 Material Design 图标导入 Android Studio 项目
- rest - Shutterstock -“您无权访问此路线”错误
- javascript - 如何使用 ES6 约定在 JS 中创建类?
- wordpress - 安装 Polylang for WooCommerce 后没有语言选项