删除" a" ggplot2中颜色图例的符号

时间:2018-02-15 14:10:09

标签: r ggplot2

当我在GGPLOT2中创建此图表时,我的颜色图例上不断显示此a

ggplot(sher_ei_si, aes(SI, EI, shape = crop, label = treatment, colour =
        management)) +
        geom_point() +
        geom_text_repel(aes(SI, EI)) +
        xlim(0, 100) +
        ylim(0, 100) +
        labs(x = "Structure", y = "Enrichment", shape = "Crop", colour =
            "Management") +
        geom_vline(xintercept = 50) +
        geom_hline(yintercept = 50) +
        scale_colour_manual(values = c("grey0", "grey60")

在彩色图例下显示a的图表 enter image description here

1 个答案:

答案 0 :(得分:0)

要准确生成输出,请提供输入数据。

您可以使用show.legend = FALSE从示例中排除a符号:

geom_text_repel(aes(SI, EI), show.legend = FALSE)