R colleagues, I am stumped. I would like the inter-tick distances to be the same on the x and y axes but cannot determine how to do so when the lower half of the y axis is not printed. Thanks for any and all suggestions. (btw, setting par(pty="s") does not solve my problem) Niels Waller M<-matrix(c(2,1, -1,3),2,2,byrow=TRUE) dimnames(M)<-list(c("P1","P2"),c("V1","V2")) writeLines(text=c("\n","Matrix M")) print(M) plot(c(-4,4),c(0,4),type="n",xlim=c(-3,3),axes=FALSE,xlab="",ylab="") axis(side=1,pos=0,labels=FALSE) axis(side=2,pos=0,labels=FALSE,at=c(0,1,2,3,4)) arrows(0,0,M[1,1],M[1,2],angle=20,length=.15,lwd=2) arrows(0,0,M[2,1],M[2,2],angle=20,length=.15,lwd=2) ******************************************************* Niels Waller, Ph.D. Director of Quantitative Methods and Evaluation Department of Psychology and Human Development Vanderbilt University Phone: (615) 322-8380 email: niels.waller at vanderbilt.edu QME Home page: http://www.vanderbilt.edu/quantmetheval/ ******************************************************* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
"niels Waller" <niels.waller at home.com> writes:> R colleagues, > > I am stumped. I would like the inter-tick distances to be the same on the x > and y axes but cannot determine how to do so when the lower half of the y > axis is not printed. Thanks for any and all suggestions. (btw, setting > par(pty="s") does not solve my problem) > > Niels WallerThis is a tough one. I think I would a) set xaxs and yaxs to "i" b) set xlim and ylim c) set pin to be proportional to the chosen limits. Try replacing the last bit of your example with par(pin=c(6,6)) plot(c(-4,4),c(0,4),type="n",xaxs="i",yaxs="i", xlim=c(-3,3),ylim=c(-1,5),axes=FALSE,xlab="",ylab="") axis(side=1,pos=0,labels=FALSE) axis(side=2,pos=0,labels=FALSE,at=c(0,1,2,3,4)) arrows(0,0,M[1,1],M[1,2],angle=20,length=.15,lwd=2) arrows(0,0,M[2,1],M[2,2],angle=20,length=.15,lwd=2)> M<-matrix(c(2,1, > -1,3),2,2,byrow=TRUE) > > dimnames(M)<-list(c("P1","P2"),c("V1","V2")) > > writeLines(text=c("\n","Matrix M")) > print(M) > > plot(c(-4,4),c(0,4),type="n",xlim=c(-3,3),axes=FALSE,xlab="",ylab="") > axis(side=1,pos=0,labels=FALSE) > axis(side=2,pos=0,labels=FALSE,at=c(0,1,2,3,4)) > arrows(0,0,M[1,1],M[1,2],angle=20,length=.15,lwd=2) > arrows(0,0,M[2,1],M[2,2],angle=20,length=.15,lwd=2)-- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 10 Sep 2001 12:05:45 -0700, you wrote in message <NCBBKMNKKMFCIGDCHLDOCEPGCKAA.niels.waller at home.com>:> > >R colleagues, > >I am stumped. I would like the inter-tick distances to be the same on the x >and y axes but cannot determine how to do so when the lower half of the y >axis is not printed. Thanks for any and all suggestions. (btw, setting >par(pty="s") does not solve my problem)I think if you use both 'par(pty="s")' and set both xlim and ylim to the same size, then the ticks have the same spacing. Doing it with your example leaves ugly space above or below the plot (so titles will appear misplaced); I don't know a simple way around that, but you can manually move titles (using the line= parameter of mtext()). M<-matrix(c(2,1, -1,3),2,2,byrow=TRUE) dimnames(M)<-list(c("P1","P2"),c("V1","V2")) writeLines(text=c("\n","Matrix M")) print(M) par(pty='s') plot(c(-4,4),c(0,4),type="n",xlim=c(-3,3),ylim=c(-1,5),axes=FALSE,xlab="",ylab="", main="Too high",sub="Too low") axis(side=1,pos=0,labels=FALSE) axis(side=2,pos=0,labels=FALSE,at=c(0,1,2,3,4)) arrows(0,0,M[1,1],M[1,2],angle=20,length=.15,lwd=2) arrows(0,0,M[2,1],M[2,2],angle=20,length=.15,lwd=2) Duncan Murdoch -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
niels Waller wrote:> > R colleagues, > > I am stumped. I would like the inter-tick distances to be the same on the x > and y axes but cannot determine how to do so when the lower half of the y > axis is not printed. Thanks for any and all suggestions. (btw, setting > par(pty="s") does not solve my problem) > > Niels Waller > > M<-matrix(c(2,1, > -1,3),2,2,byrow=TRUE) > > dimnames(M)<-list(c("P1","P2"),c("V1","V2")) > > writeLines(text=c("\n","Matrix M")) > print(M)Let me add two lines: postscript("file.ps", width=3, height=3)> plot(c(-4,4),c(0,4),type="n",xlim=c(-3,3),axes=FALSE,xlab="",ylab="") > axis(side=1,pos=0,labels=FALSE) > axis(side=2,pos=0,labels=FALSE,at=c(0,1,2,3,4)) > arrows(0,0,M[1,1],M[1,2],angle=20,length=.15,lwd=2) > arrows(0,0,M[2,1],M[2,2],angle=20,length=.15,lwd=2)dev.off() I think "inter-tick distance" *is* already the same in the postscript file. For the windows() device (I don't know your OS) you can use windows(rescale="fit", xpinch=102, ypinch=77) instead of postscript() but maybe xpinch/ypinch must be adjusted for your system. Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._