Re: [R] Color scale graphic

From: Greg Snow <>
Date: Mon, 07 Jun 2010 14:44:03 -0600

Do you just want a rectangle with different vertical color bands? Then look at the image function. Do you want a small rectangle that goes the length of the x-axis with these color bands, but gives room for another plot above that? Then look at the subplot function (TeachingDemos package) along with the image function.

If neither of those help, give us a better description and/or example of what you want your plot to look like.

Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare

> -----Original Message-----
> From: [mailto:r-help-bounces_at_r-
>] On Behalf Of Diogo_Silva
> Sent: Saturday, June 05, 2010 6:03 PM
> To:
> Subject: [R] Color scale graphic
> Hello
> Recently, I've been dealing with a seemingly simple problem. I have a
> table
> with two columns filled with values from a test I made (say, amount of
> precipitation and Months measured). Now, instead of plotting a typical
> linear graphic with precipitation on the y-axis and the months in the
> x-axys, I would like to "convert" the values of precipitation in a
> color
> gradient, resulting in a vertical gradient throughout the x-axis. In
> this
> way, months with higher precipitation would appear reddish while lower
> precipitation would appear blueish, for example. Despite being a simple
> problem (basically converting the y-values in a color gradient), I have
> failed to find a way of doing this.
> If someone knows how to solve this, either using R or other program,
> please
> lend me a hand.
> Thanks for your attention
> Diogo
> --
> View this message in context:
> scale-graphic-tp2244657p2244657.html
> Sent from the R help mailing list archive at
> ______________________________________________
> mailing list
> PLEASE do read the posting guide
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
______________________________________________ mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code.
Received on Mon 07 Jun 2010 - 21:04:57 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 07 Jun 2010 - 21:20:28 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive