我使用 hjust 在我的条形图中添加了标签,但由于某种原因,对于具有更高值的条形,它们离它们更远。理想情况下,我希望它们都离每个酒吧都很近。
plot_snpEff_annotations <- ggplot(plot_METTL14_can_exome_annotations, aes(plot_METTL14_can_exome_annotations$snpEff_Annotation)) +
geom_bar(position = "dodge", color = "black", fill=my_palette) +
theme_minimal() +
coord_flip() +
geom_text(aes(label = ..count.., hjust = -1), stat="count", size = 3) +
labs(title = "Types of Variants in METTL14", subtitle = "snpEff Annotation",
x = "Count", y = "Variant Type")
plot_snpEff_annotations
