COLOR(red){SIZE(20){カラーチャート}}
一番最後に,これを作ったソースを添付
#ref(colorchart01.png LEFT)
#ref(colorchart01.png)
#ref(colorchart02.png)
#ref(colorchart03.png)
#ref(colorchart04.png)
#ref(colorchart05.png)
#ref(colorchart06.png)
#ref(colorchart07.png)
#ref(colorchart08.png)
#ref(colorchart09.png)
*ソース
polygon.plot <- function(row, col, name, name.of.color, height, cell.width, cell.height)
{
row <- row*cell.width
col <- col*cell.height
ordinate.x <- c(row, row, row+cell.width, row+cell.width, row)
ordinate.y <- height-c(col, col+cell.height, col+cell.height, col, col)
polygon(ordinate.x, ordinate.y, col=name.of.color)
text(row+cell.width*0.1, height-(col+cell.height*0.6), name, pos=4)
text(row+cell.width*0.1, height-(col+cell.height*0.4), name.of.color, pos=4)
text(row+cell.width*0.1, height-(col+cell.height*0.2),
name.of.color,pos=4,col="white")
}
color.chart <- function(n.width=8, n.height=10)
{
width <- 1200
height <- 900
name.of.color <- colors()
n <- length(name.of.color)
max <- floor(n/(n.width*n.height))
pdf("colorchart%02i.pdf", onefile=FALSE, width=width/72, height=height/72)
for (i in 0:max) {
plot(c(0, width, width, 0, 0), c(0, 0, height, height, 0),type="n", xaxt="n",
yaxt="n", xlab="",ylab="")
for (col in 0:(n.height-1)) {
for (row in 0:(n.width-1)) {
name <- (n.width*n.height)*i+col*n.width+row+1
cat(name, ", ", name.of.color[name], "¥n")
polygon.plot(row, col, name, name.of.color[name], height,
width/n.width, height/n.height)
}
}
}
dev.off()
}