[R] plotting points with two colors

David Winsemius dwinsemius at comcast.net
Tue Jan 20 18:48:05 CET 2009


plot(x <- rnorm(47), type = "p", main = "plot(x, type = \"p\")", col =  
c("dark red","blue"))

If you plan to have a system for the coloring, you need to get the  
values sequence-aligned with the colors. This just colors every other  
point "blue".
David Winsemius

On Jan 20, 2009, at 12:23 PM, Georg Ehret wrote:

> Dear Miss R,
>    I am trying to plot a scatterplot in which the points (round)  
> should
> have two colors: half red and half blue (if you want: two half solid  
> circles
> put together. Can you please help me to realize this efficiently?
> Thank you,
> Best regards, Georg.
> ***************************************
> Georg Ehret
> Geneva University Hospital
> Geneva, Switzerland
> 	[[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.

More information about the R-help mailing list