张金龙的博客分享 http://blog.sciencenet.cn/u/zjlcas 物种适应性、分布与进化

博文

山寨版 Color Checker

已有 5032 次阅读 2015-4-16 17:46 |个人分类:行摄匆匆|系统分类:生活其它

山寨版 Color Checker


#### 颜色

colours<-c("#735244", "#c29682", "#627a9d", "#576c43", "#8580b1", "#67bdaa", "#d67e2c", "#505ba6",

 "#c15a63", "#5e3c6c", "#9dbc40", "#e0a32e", "#383d96", "#469449", "#af363c", "#e7c71f",

 "#bb5695", "#0885a1", "#f3f3f2", "#c8c8c8", "#a0a0a0", "#7a7a79", "#555555", "#343434")

#### xy矩阵

x =1:24

y =1:24

dim(x)<-c(4, 6)

dim(y)<-c(4, 6)

x1 =2

y1 =-2

for(i in1:6){

  for(j in1:4){

      x[j, i]<-x1 +i*(13.5+2)

      y[j, i]<-y1 -j*(13.5+2)

  }

}

#### 定义颜色块出现的位置

x2 <-x -13.5

y2 <-y -13.5

### pdf(file ="color.checkerNaNyk.pdf", width =4, height = 3,colormodel="cmyk")

#pdf(file = "color.checker.rgb.pdf", width =4.2,height = 3)

par(bg ='black', mar =c(0,0,.8,0))

plot(1, xlim=c(5, 94), ylim =c(-77, -18),pch ="")

cols <-colours

k =1

for(i in1:4){

  for(j in1:6){

      rect(x[i,j],y[i,j],x2[i,j],y2[i,j],col= cols[k])

      k =k +1

  }

}

mtext("Colour Checker in RGB",side =3, line=.01, col="white",cex =0.6)


#dev.off()

#pdf(file ="color.checker.CMYK.pdf", width =4.2, height =3,colormodel="cmyk")

par(bg ='black', mar =c(0,0,.8,0))

plot(1, xlim=c(5, 94), ylim =c(-77, -18),pch ="")

cols <-colours

k =1

for(i in1:4){

  for(j in1:6){

      rect(x[i,j],y[i,j],x2[i,j],y2[i,j],col= cols[k])

      k =k +1

  }

}

mtext("Colour Checker in CMYK",side =3, line=.01, col="white",cex =0.6)

#dev.off()






https://blog.sciencenet.cn/blog-255662-882960.html

上一篇:Windows从源代码安装R程序包-以安装picante程序包为例
下一篇:R中调用FORTRAN的两种方式
收藏 IP: 113.28.150.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-12-23 20:55

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部