ggplot中点的样式展示:
library(ggplot2)# 创建数据框
a<- data.frame(x = 0:25, y = 0:25)
# 创建散点图
ggplot(a, aes(x = x, y = y, shape = as.factor(y))) +geom_point(size = 4) +scale_shape_manual(values = 0:25) +labs(shape = "形状") +theme(legend.direction = "vertical",legend.position = "bottom",legend.key = element_rect(colour = "white", fill = "white"))
示例图如下: