[R] questions about scatterplotMatrix

John Fox jfox at mcmaster.ca
Wed Dec 7 14:11:12 CET 2011


Dear Wendy,

This must be the scatterplotMatrix() function in the car package. If I
understand correctly what you want, the following should do it:

scatterplotMatrix(~ income + education + prestige, 
	smooth = FALSE, data=Duncan,  diagonal="none", 
	reg.line=function(...) abline(0,1), 
	xlim=c(0, 100), ylim=c(0, 100))

(The reg.line argument must be a function.)

I hope this helps,
 John

--------------------------------
John Fox
Senator William McMaster
  Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox




> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Wendy
> Sent: December-06-11 10:46 PM
> To: r-help at r-project.org
> Subject: [R] questions about scatterplotMatrix
> 
> Hi all,
> 
> I want to plot some data with scatterplotMatrix. I want to set all axis
> limits of all the sub figures the same, also add abline(0,1) to all the
> sub figures. Using the code following code, I can only add abline to
> the first off-diagonal figure, and I did not figure out how to set all
> the axis limits the same.
> 
> 
> scatterplotMatrix(~ income + education + prestige, smooth =
> FALSE,transform=FALSE,
> data=Duncan,robust=TRUE,diagonal="none",plot.points =
> TRUE,reg.line=abline(0,1))
> 
> Does anybody know how to achieve this? Any advice is appreciated. Thank
> you.
> 
> Wendy
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/questions-
> about-scatterplotMatrix-tp4167576p4167576.html
> Sent from the R help mailing list archive at Nabble.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