R语言中points 函数

 

001、R语言中points 函数

plot(1:5, 1:5, xlim = c(1,6), ylim = c(1,6), type = "n")
points(c(3,3), c(2,5), cex = 2, col = "red", pch = 13)

 

002、 调整大小、颜色

plot(1:5, 1:5, xlim = c(1,6), ylim = c(1,6), type = "n")
points(c(3,3), c(2,5), cex = c(1,5), col = c("red", "cyan"), pch = 16)

 

003、矩阵生成

复制代码
plot(1:5, 1:5, xlim = c(0,6), ylim = c(0, 6), type = "n")
idx = 0
for (i in 1:5) {
  for (j in 1:5) {
  idx = idx + 1
  points(i, j, pch = idx, cex = 1.5, col = "magenta")
  text(i,j, labels = idx, pos = 3, offset = 1)
  }
  
}
复制代码

 

004、设置形状的填充色,只有pch的21-25才有填充色

复制代码
plot(1:5, 1:5, xlim = c(0,6), ylim = c(0, 6), type = "n")
idx = 0
for (i in 1:5) {
  for (j in 1:5) {
  idx = idx + 1
  points(i, j, pch = idx, cex = 1.5, bg = "magenta")
  text(i,j, labels = idx, pos = 3, offset = 1)
  }
  
}
复制代码

 。

 

posted @   小鲨鱼2018  阅读(2)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2024-02-25 linux 中 du -sh 和 du -ch的区别
2024-02-25 linux 中输出指定目录下所有一级目录的大小以及磁盘占用最大的目录
2023-02-25 ubuntu 22.04中配置静态IP
2023-02-25 linux 中 sed命令中的q选项
2023-02-25 linux 中awk命令 制定 输入行分隔符、列分割符、输出行分隔符、输出列分隔符的几种方法
2023-02-25 linux 命令行中 几个高效快捷键
2021-02-25 python中字典的键不允许重复
点击右上角即可分享
微信分享提示