[R] Re : image.plot specify colors for range of data points, please help
David Lyon
david_lyon3 at yahoo.com
Tue Apr 17 17:53:09 CEST 2012
Thank you so much!
----- Original Message -----
From: Pascal Oettli <kridox at ymail.com>
To: David Lyon <david_lyon3 at yahoo.com>
Cc: "r-help at r-project.org" <r-help at r-project.org>
Sent: Tuesday, April 17, 2012 11:31 AM
Subject: Re : [R] image.plot specify colors for range of data points, please help
Hi,
> image.plot(x, breaks=c(-100,-1,1,100), col=c('green','black','red'))
Regards,
Pascal
----- Mail original -----
De : David Lyon <david_lyon3 at yahoo.com>
À : "r-help at r-project.org" <r-help at r-project.org>
Cc :
Envoyé le : Mercredi 18 avril 2012 0h00
Objet : [R] image.plot specify colors for range of data points, please help
Hi
If I had a dataset of the following below and I want to plot colors for this image.plot so that:
red for data above 1
black for data between/equal 1 and -1
green for data below -1
normally its:
image.plot(data) but how do I add the colors for the range of data points as above?
Many thanks for your help!
_DATA_
2.04
2.02
1.60
1.92
0.98
0.50
0.40
-0.50
-0.40
-1.90
-2.8
______________________________________________
R-help at 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.
More information about the R-help
mailing list