Re: [R] diagonally fill a rectangle with color gradient

2008-04-09 Thread Greg Snow
Here are a couple of ways using base graphics: library(TeachingDemos) x - y - seq(0,1,length.out=100) tmp - expand.grid(x=x,y=y) z - matrix( tmp$x + tmp$y, 100 ) plot( 0:1, 0:1, type='n', xlab='x', ylab='y' ) subplot( image(x,y,z, col=topo.colors(100), axes=FALSE, xlab='', ylab=''), +

Re: [R] diagonally fill a rectangle with color gradient

2008-04-08 Thread Paul Murrell
Hi tom soyer wrote: Hi, Is it possible to diagonally fill a rectangle with a color gradient? I noticed that the gradient.rect of plotrix could fill a rect either up and down or from side to side. I am looking for something similar but fills diagonally instead, e.g., from the upper left