[R] How to add background color of a 2D chart by quadrant
Greg.Snow at imail.org
Mon Apr 7 22:14:36 CEST 2008
The basic approach is:
1. call plot (sets up the main plotting)
2. call rect for each quadrant (or polygon if you prefer)
3. add the points with the points function (replotting any points
covered by the rectangles)
4. add any additional notation (calling functions such as text, axis,
If you need the coordinates to use for your corners in step 2, look at
?par and scroll to the section on 'usr', or look at ?grconvertX in R2.7,
or the cnvrt.coords function in the TeachingDemos package.
If that does not do what you want, give us some more detail on what you
are trying to accomplish.
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of tom soyer
> Sent: Monday, April 07, 2008 2:02 PM
> To: r-help at r-project.org
> Subject: [R] How to add background color of a 2D chart by quadrant
> I have a 2D chart that is divided into four quadrants, I, II, III, IV:
> I would like to fill each quadrant with a background color
> unique to the quadrant. Does anyone know how to do this in R?
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help