[R] lines at margin?

Greg Snow Greg.Snow at intermountainmail.org
Mon Oct 9 21:27:12 CEST 2006


The cnvrt.coords fnuction in the TeachingDemos package may simplify the
procces of getting the coordinates.

Hope this helps, 


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

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Marc Schwartz
(via MN)
Sent: Monday, October 09, 2006 9:18 AM
To: Mike Wolfgang
Cc: R-help list
Subject: Re: [R] lines at margin?

On Mon, 2006-10-09 at 10:56 -0400, Mike Wolfgang wrote:
> Hi list,
> 
> I want to add some lines at margin area of one figure. mtext could add

> text to these margins, can I add lines with different lty parameters? 
> Thanks,
> 
> mike

You can do it, but it will take some fiddling to get the coordinates
right:

 # Do a generic plot
 plot(1:10)

 # Get the current plot region axis ranges  # x1, x2, y1, y2
 par("usr")
 [1]  0.64 10.36  0.64 10.36

 # Draw a vertical line in the right hand margin  # Set 'xpd = TRUE' so
that plotting is not  # clipped at the plot region boundary
segments(10.75, 4, 10.75, 6, xpd = TRUE)

See ?par for more information.

HTH,

Marc Schwartz

______________________________________________
R-help at stat.math.ethz.ch 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