[R] graph paper look

David L Carlson dcarlson at tamu.edu
Thu Jan 19 16:55:05 CET 2012


You could look at grid(), but the Note in the documentation suggests "If
more fine tuning is required, use abline(h = ., v = .) directly." Also
grid() uses the default axis positions so if you specify details of the axis
with xlim, ylim, etc the grid does not line up on the tickmarks. 

Using abline is pretty simple. Use xpd=TRUE to get abline to draw outside
the plot region.

oldpar <- par(xpd=TRUE)
plot(c(0,1),c(0,1), axes=FALSE, pch=NA, xlab="", ylab="") 
abline(v=seq(-1, 2, .1), h=seq(-1, 2, .1), lty=3, col="gray")
abline(v=seq(-1, 2, .5), h=seq(-1, 2, .5), lty=1, col="gray")
par(oldpar)

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352


-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Erin Hodgess
Sent: Wednesday, January 18, 2012 7:19 PM
To: r-help at r-project.org
Subject: [R] graph paper look

Dear R People:

Short of doing a series of ablines, is there a way to produce "graph
paper" in R please?

Thanks,
Erin


-- 
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: erinm.hodgess at gmail.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.



More information about the R-help mailing list