Skip to content
Prev 146442 / 398500 Next

color scale mapped to B/W

Try this (you need tcl 8.5 and the TeachingDemos package):

library(teachingDemos)
tmpplot <- function(col1='red', col2='yellow', col3='green'){
 plot(1:10,1:10, type='n')
 rect(1,1,4,4, col=col1)
 rect(1,4,4,7, col=col2)
 rect(1,7,4,10, col=col3)
 rect(6,1,9,4, col=col2grey(col1))
 rect(6,4,9,7, col=col2grey(col2))
 rect(6,7,9,10, col=col2grey(col3))
 text(5, c(2,5,8), c(col1, col2, col3))
}
cols <- colors()[ -c( 152:253, 260:361) ]

tkexamp( tmpplot(), list(col1=list('combobox', values=cols, init='red'),
 col2=list('combobox',values=cols, init='yellow'),
 col3=list('combobox',values=cols, init='green') ) )

Hope it helps,