RE: [R] color scale to label a plot

From: Charles Annis, P.E. <Charles.Annis_at_statisticalengineering.com>
Date: Fri 16 Jul 2004 - 03:02:52 EST


Anne:

Perhaps this example will help.

I have data (several dozen observations at each condition) for different R=stress.ratio. The stress.ratios are:

> stress.ratio

 [1] 0.1 0.1 0.1 0.2 0.3 0.5 0.6 0.7 0.8 0.9 0.9 0.9 0.9 0.9 0.9

You will notice multiple datasets for R=0.1 and R=0.9.

I assigned colors to each stress.ratio, such that

 R.color

 [1] "black"      "black"      "black"      "red"        "orange"     "gray"
"green"      "light blue" "blue"       "dark blue" 
[11] "dark blue"  "dark blue"  "dark blue"  "dark blue"  "dark blue" 


Then I plotted the legend on my plot this way:

legend(x.coordinate, y.coordinate, unique(stress.ratio), col=unique(R.color), pch=15, cex=0.8)

Best wishes.

Charles Annis, P.E.  

Charles.Annis@StatisticalEngineering.com phone: 561-352-9699
eFax: 503-217-5849
http://www.StatisticalEngineering.com
-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Anne Sent: Thursday, July 15, 2004 12:42 PM
To: r-help@stat.math.ethz.ch; Berton Gunter Subject: Re: [R] color scale to label a plot

yes.. legend sould help. I still do not know how to paint my color sacle and put the corresp. labels correctly
Thanks
Anne

> Do you mean ?legend ??
>
> On lattice plots, the key= argument controls legends. ?xyplot gives
details.
>
>
>
> --
>
> Bert Gunter
>
> Non-Clinical Biostatistics
> Genentech
> MS: 240B
> Phone: 650-467-7374
>
>
> "The business of the statistician is to catalyze the scientific learning
process."
>
> -- George E.P. Box
>
>



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jul 16 03:17:46 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:54:59 EST