【R语言】ggplot中点的样式shape参数汇总

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"))

示例图如下:

相关推荐

  1. R语言ggplot2图例位置、颜色、背景、标题

    2024-05-25 20:28:46       46 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-05-25 20:28:46       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-05-25 20:28:46       106 阅读
  3. 在Django里面运行非项目文件

    2024-05-25 20:28:46       87 阅读
  4. Python语言-面向对象

    2024-05-25 20:28:46       96 阅读

热门阅读

  1. 客户机/服务器交互模式

    2024-05-25 20:28:46       34 阅读
  2. 程序员搞副业的障碍有那些?

    2024-05-25 20:28:46       31 阅读
  3. em,rem,vw,vh,px,rpx,%的用法

    2024-05-25 20:28:46       34 阅读
  4. Spring Boot: 为 JPA 插上翅膀的 QueryDSL

    2024-05-25 20:28:46       31 阅读
  5. leetcode143-Reorder List

    2024-05-25 20:28:46       30 阅读
  6. 实现C++ List,双端链表和静态链表

    2024-05-25 20:28:46       30 阅读
  7. Python和Plotly绘制3D图形的小说明

    2024-05-25 20:28:46       37 阅读