Re: [R] coloring a graph left or right of an abline

From: Greg Snow <Greg.Snow_at_imail.org>
Date: Fri, 22 Feb 2008 11:25:16 -0700

Here is one approach:

> library(TeachingDemos)
>
> x <- rnorm(1000)
>
> hist(x)
> clipplot( hist(x, col='blue', add=TRUE), xlim=c(0.2,par('usr')[2] ) )
> clipplot( hist(x, col='red', add=TRUE), xlim=c( par('usr')[1], 0.2 ) )
> abline(v=0.2, col='green', lwd=5)
>

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_imail.org
(801) 408-8111
 
 


> -----Original Message-----
> From: r-help-bounces_at_r-project.org
> [mailto:r-help-bounces_at_r-project.org] On Behalf Of Georg Ehret
> Sent: Thursday, February 21, 2008 12:49 PM
> To: r-help
> Subject: [R] coloring a graph left or right of an abline
>
> Dear R community,
> I would wish to color the background of my histogram
> differently to the left and right of an abline... Can you please help?
>
> Thankin you,
> Georg.
>
> ****************************
> Georg Ehret
> JHU
> Baltimore - USA
>
> [[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.
>
______________________________________________ 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 Fri 22 Feb 2008 - 18:28:08 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 Fri 22 Feb 2008 - 18:30:15 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