如何在geom_point ggplot中删除点组

尼古拉波

我的情节有问题。我只想在组A中显示点,而不要在每个名称中显示。这是一个例子:

name <- c("a","b","c","d")
df <- data.frame(id = rep(1:5,3), 
             value = c(seq(50,58,2),seq(60,68,2),seq(70,78,2)),
             name = c(rep("A",5),rep("B",5),rep("C",5)),
             type = rep(c("a","b","c","d","r"),3))

df$name <- factor(df$name, levels = c("C","B","A"),ordered = TRUE)
ggplot(df, aes(id, value, fill = name,color = type))+
    geom_area( position = 'identity', linetype = 1, size = 1 ,colour="black") +
    geom_point(size = 8)+
    guides(fill = guide_legend(override.aes = list(colour = NULL, shape = NA)))

在此处输入图片说明

爵士乐

如果我正确阅读了该问题,似乎您只想为蓝色区域添加点。在这种情况下,您可以将数据子集并将其用于geom_point

ggplot(df, aes(id, value, fill = name,color = type))+
geom_area( position = 'identity', linetype = 1, size = 1 ,colour="black") +
geom_point(data = subset(df, name == "A"), size = 8) +
guides(fill = guide_legend(override.aes = list(colour = NULL, shape = NA)))

在此处输入图片说明

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

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

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

在geom_point中使用cut时如何在ggplot中添加椭圆

来自分类Dev

如何在gganimate中为geom_point使用您自己的图像?

来自分类Dev

如何在R中使用ggplot2根据大小为节点/ geom_point渐变着色?

来自分类Dev

将geom_point覆盖到geom_bar。如何对齐点和条?

来自分类Dev

在ggplot中将组均值添加到geom_point()

来自分类Dev

R中的Geom_text()-如何更改geom_point中特定点的标签位置

来自分类Dev

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

来自分类Dev

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

来自分类Dev

无论如何要更改 R (geom_point) 中 ggplot 中值的大小?

来自分类Dev

来自geom_point中相同副本的点之间的线

来自分类Dev

R:如何使用geom_point将点添加到并排错误栏

来自分类Dev

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

来自分类Dev

ggplot geom_point中的最小点大小增加

来自分类Dev

ggplot2 2.0.0中的geom_point边界

来自分类Dev

ggplot geom_point中的最小点大小增加

来自分类Dev

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

来自分类Dev

增加ggplot geom_point中的最小点大小

来自分类Dev

geom_point {ggplot2}中的alpha值

来自分类Dev

ggplot2 中的振幅线 + geom_point

来自分类Dev

如何用点的颜色填充geom_point图例中的框,而不仅仅是增加它们的大小?

来自分类Dev

ggplot:两组的geom_line和geom_point重叠顺序?

来自分类Dev

如何从geom_point中删除图例,并将两条平滑线的线型图例移至图形内部

来自分类Dev

通过两组区分geom_point

来自分类Dev

Geom_point将点设置为错误的值

来自分类Dev

使用alpha使geom_point点的颜色稍微变浅吗?

来自分类Dev

Geom_point将点设置为错误的值

来自分类Dev

ggplot2 geom_point 50000点-输出为pdf-需要在Illustrator中打开

来自分类Dev

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

来自分类Dev

矩形ggplot2 geom_point形状

Related 相关文章

  1. 1

    在geom_point中使用cut时如何在ggplot中添加椭圆

  2. 2

    如何在gganimate中为geom_point使用您自己的图像?

  3. 3

    如何在R中使用ggplot2根据大小为节点/ geom_point渐变着色?

  4. 4

    将geom_point覆盖到geom_bar。如何对齐点和条?

  5. 5

    在ggplot中将组均值添加到geom_point()

  6. 6

    R中的Geom_text()-如何更改geom_point中特定点的标签位置

  7. 7

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

  8. 8

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

  9. 9

    无论如何要更改 R (geom_point) 中 ggplot 中值的大小?

  10. 10

    来自geom_point中相同副本的点之间的线

  11. 11

    R:如何使用geom_point将点添加到并排错误栏

  12. 12

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

  13. 13

    ggplot geom_point中的最小点大小增加

  14. 14

    ggplot2 2.0.0中的geom_point边界

  15. 15

    ggplot geom_point中的最小点大小增加

  16. 16

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

  17. 17

    增加ggplot geom_point中的最小点大小

  18. 18

    geom_point {ggplot2}中的alpha值

  19. 19

    ggplot2 中的振幅线 + geom_point

  20. 20

    如何用点的颜色填充geom_point图例中的框,而不仅仅是增加它们的大小?

  21. 21

    ggplot:两组的geom_line和geom_point重叠顺序?

  22. 22

    如何从geom_point中删除图例,并将两条平滑线的线型图例移至图形内部

  23. 23

    通过两组区分geom_point

  24. 24

    Geom_point将点设置为错误的值

  25. 25

    使用alpha使geom_point点的颜色稍微变浅吗?

  26. 26

    Geom_point将点设置为错误的值

  27. 27

    ggplot2 geom_point 50000点-输出为pdf-需要在Illustrator中打开

  28. 28

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

  29. 29

    矩形ggplot2 geom_point形状

热门标签

归档