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=''),
+
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
2 matches
Mail list logo