r - 如何使用填充颜色为 ggforce::geom_mark_ellipse 标签着色
问题描述
目前是否可以使用彩色生成标签?ggforce::geom_mark_ellipse(label=)
在下面的示例中,我希望看到绿色的杂色字体:
解决方案
是的,但不像任何其他映射美学那样直接。您必须构建一个新图层,在其中更改颜色并正确过滤图层。如果您有 10 多个组,每个组都需要自己的标签颜色,您会发现这变得非常费力。
library(ggplot2)
library(ggforce)
ggplot(iris, aes(Petal.Length, Petal.Width)) +
geom_mark_ellipse(aes(fill = Species, label = Species,
filter = Species != 'versicolor')) +
geom_mark_ellipse(aes(fill = Species, label = Species,
filter = Species == 'versicolor'),
label.colour = "green") +
geom_point()
推荐阅读
- python - 从 azure python sdk JWK 生成 jwcrypto JWK
- elasticsearch - NEST 通过过滤的嵌套文档进行弹性排序
- spring-boot - Spring Boot - 几天后无法获取 JDBC 源
- python - 在 Keras 上创建 Bagnet
- ios - 自定义 UITableViewCell 一些 IBOutlet 元素为 nil
- bash - 使用 group 命令和 openssl 的 Bash 超时
- python-3.x - 如何从远程设备获取文件名?
- python - 使用虚拟编码器时出现内存错误
- visual-studio - 如何验证 Android SDK 模拟器是否在 Hyper-V 中运行
- azure - Powershell 中使用 --runtime 命令设置 Jenkins 管道的问题