如何更改ggplot2的geom_point中缺失值的颜色?

Bangyou

默认情况下,ggplot2的geom_point中的缺失点为灰色。我该如何将其更改为另一种颜色?

这些是重复我的问题的代码。

df <- data.frame(x = 1:10, y = 1:10, z = c(rep(1, 4), rep(NA, 2), rep(2, 4)))
require(ggplot2)
ggplot(df, aes(x, y, colour = factor(z))) + geom_point(size = 4)

感谢您的任何建议。

布罗迪
ggplot(df, aes(x, y, colour = factor(z))) + geom_point(size = 4) +
  scale_color_discrete(na.value="yellow")

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何更改ggplot2的geom_point中缺失值的颜色?

来自分类Dev

为ggplot2中的两个geom_point()更改颜色

来自分类Dev

geom_point {ggplot2}中的alpha值

来自分类Dev

有没有办法在 R 中更改 ggplot2 (geom_point) 中的大小值范围?

来自分类Dev

为ggplot2中的负值和正值在geom_point中设置不同的颜色

来自分类Dev

更改中点 geom_point ggplot2 R

来自分类Dev

使用aes_string时,ggplot2中两个geom_point()的颜色

来自分类Dev

ggplot2 2.0.0中的geom_point边界

来自分类Dev

ggplot2 中的振幅线 + geom_point

来自分类Dev

R ggplot2:如何绘制具有纯色和透明笔触并根据颜色着色的geom_point?

来自分类Dev

ggplot2:一些geom_point形状导致颜色奇怪

来自分类Dev

使stat_ellipse {ggplot2}轮廓geom_point填充颜色

来自分类Dev

ggplot2:geom_point() 躲避形状但不是颜色

来自分类Dev

ggplot geom_point(),其颜色基于特定的离散值

来自分类Dev

如何更改geom_miss_point中缺失值的颜色(具有两个不同的色标)

来自分类Dev

ggplot2减少geom_point()因子之间的空间

来自分类Dev

矩形ggplot2 geom_point形状

来自分类Dev

带有ggplot2和geom_point的图例

来自分类Dev

ggplot2 geom_point具有图案填充

来自分类Dev

填充地图上geom_point的ggplot2图例

来自分类Dev

带有ggplot2和geom_point的图例

来自分类Dev

矩形ggplot2 geom_point形状

来自分类Dev

ggplot:geom_point中的颜色,填充和大小

来自分类Dev

如何在geom_bar ggplot2中更改颜色,否则无法正常工作

来自分类Dev

R ggplot2-如何为两个geom_point指定不同的颜色

来自分类Dev

使用geom_point有条件地使用ggplot2中的抖动

来自分类Dev

避免在ggplot2中使用geom_point进行图覆盖

来自分类Dev

将高斯拟合到ggplot2中的数据geom_point

来自分类Dev

如何在ggplot2的图例中显示缺失值?

Related 相关文章

  1. 1

    如何更改ggplot2的geom_point中缺失值的颜色?

  2. 2

    为ggplot2中的两个geom_point()更改颜色

  3. 3

    geom_point {ggplot2}中的alpha值

  4. 4

    有没有办法在 R 中更改 ggplot2 (geom_point) 中的大小值范围?

  5. 5

    为ggplot2中的负值和正值在geom_point中设置不同的颜色

  6. 6

    更改中点 geom_point ggplot2 R

  7. 7

    使用aes_string时,ggplot2中两个geom_point()的颜色

  8. 8

    ggplot2 2.0.0中的geom_point边界

  9. 9

    ggplot2 中的振幅线 + geom_point

  10. 10

    R ggplot2:如何绘制具有纯色和透明笔触并根据颜色着色的geom_point?

  11. 11

    ggplot2:一些geom_point形状导致颜色奇怪

  12. 12

    使stat_ellipse {ggplot2}轮廓geom_point填充颜色

  13. 13

    ggplot2:geom_point() 躲避形状但不是颜色

  14. 14

    ggplot geom_point(),其颜色基于特定的离散值

  15. 15

    如何更改geom_miss_point中缺失值的颜色(具有两个不同的色标)

  16. 16

    ggplot2减少geom_point()因子之间的空间

  17. 17

    矩形ggplot2 geom_point形状

  18. 18

    带有ggplot2和geom_point的图例

  19. 19

    ggplot2 geom_point具有图案填充

  20. 20

    填充地图上geom_point的ggplot2图例

  21. 21

    带有ggplot2和geom_point的图例

  22. 22

    矩形ggplot2 geom_point形状

  23. 23

    ggplot:geom_point中的颜色,填充和大小

  24. 24

    如何在geom_bar ggplot2中更改颜色,否则无法正常工作

  25. 25

    R ggplot2-如何为两个geom_point指定不同的颜色

  26. 26

    使用geom_point有条件地使用ggplot2中的抖动

  27. 27

    避免在ggplot2中使用geom_point进行图覆盖

  28. 28

    将高斯拟合到ggplot2中的数据geom_point

  29. 29

    如何在ggplot2的图例中显示缺失值?

热门标签

归档