On 07/03/2012 06:21 AM, Joseph Clark wrote:
These "carpet plots" are also called "heat maps" and there's a current thread with the
subject line "Heat Maps" in which I've given a couple of examples of code for them. The R function
image() is very easy to use:
image( x=(x values), y=(y values), z=(matrix of z values with x rows and y
columns), col=(vector of colors), breaks=(vector of break points, one more than
colors) )
What I'd like to know is: does anyone know how to easily create a legend/key to
the color gradients, like the one in the right margin of Mueller's first
example:
(http://www.johannes-hopf.de/wordpress/wp-content/uploads/2009/12/Zufall-300x225.png)?
Hi Joseph,
Have a look at color2D.matplot and color.legend in the plotrix package.
There is also sampcolorlegend in the shape package.
Jim
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.