我尝试了很多建议,但没有一个适合这个特别简单的例子。如何将图例标题更改为 Sample?
df1 <- data.frame(
Order = c(1,1,2,2),
Tissue = c("Bladder","Pancreas","Bladder","Pancreas"),
Sample = c("WT","WT","Mutant","Mutant"),
Percent = c(94.12,55,5.88,45)
)
ggplot(data = df1, aes(x = Tissue, y = Percent, group = Sample)) +
geom_point(aes(shape=reorder(Sample,Order), fill=reorder(Sample,Order)), size = 6) +
scale_shape_manual(values=c(21,22)) +
scale_fill_manual(values=c("deepskyblue1","yellow"))
谢谢你。