Re: [R] Plot colors

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Thu, 29 May 2008 16:12:01 -0300

Try:

x <- c(1,2,1,1,6,7,-1,-1,5,-1)
plot(x, col = ifelse(x == -1, "red", "black"), pch = 16)

On Thu, May 29, 2008 at 1:23 PM, uv <uvtravel_at_hotmail.com> wrote:

>
> Hi. I am plotting graphs for values ranging between -1 and 10, for example:
> (1,2,1,1,6,7,-1,-1,5,-1)
> I am trying to plot the graphs so that the points with value of -1 will be
> in one specific color, and the rest of the points will be in one different
> specific color. I would be grateful for any idea of how to do that in two
> colors.
> Thanks for any hint.
> --
> View this message in context:
> http://www.nabble.com/Plot-colors-tp17539738p17539738.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

	[[alternative HTML version deleted]]


______________________________________________ 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.

Received on Thu 29 May 2008 - 19:30:44 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 Thu 29 May 2008 - 20:32:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive