francois_birgand at ncsu.edu
2009-Sep-25 20:55 UTC
[Rd] xaxs disactivated when asp=1 in plots (PR#13971)
Full_Name: Fran?ois Birgand Version: 2.9.0 OS: windows xp Submission from: (NULL) (152.1.16.161) When I type this sequence: x11() Ylim<-c(0,14) Xlim<-c(0,14) plot(0,0,xlim=Xlim,ylim=Ylim,col="white",main="",xlab="",ylab="",bty="n",xaxt="n",yaxt="n",xaxs="i",yaxs="i",asp=1) abline(h=c(0,14),lwd=2,col="grey") abline(v=c(0,14),lwd=2,col="grey") par(new=TRUE) abline(h=seq(0,14,by=0.2),lty=3,col="grey") abline(h=seq(0,14,by=1),lty=1,col="grey") abline(v=seq(0,14,by=0.2),lty=3,col="grey") abline(v=seq(0,14,by=1),lty=1,col="grey") par(new=TRUE) only yaxs="i" is taken into account while xaxs="i" is ignored. When I remove asp=1, xaxs="i" is activated again. Small bug but kind of bothersome...!! Congratulations for the great work you guys are doing! Fran?ois
Not a bug, see ?plot.window that tells us: asp: If asp is a finite positive value then the window is set up so that one data unit in the x direction is equal in length to asp * one data unit in the y direction. Note that in this case, par("usr") is no longer determined by, e.g., par("xaxs"), but rather by asp and the device's aspect ratio. (See what happens if you interactively resize the plot device after running the example below!) Best, Uwe Ligges francois_birgand at ncsu.edu wrote:> Full_Name: Fran?ois Birgand > Version: 2.9.0 > OS: windows xp > Submission from: (NULL) (152.1.16.161) > > > When I type this sequence: > > x11() > Ylim<-c(0,14) > Xlim<-c(0,14) > plot(0,0,xlim=Xlim,ylim=Ylim,col="white",main="",xlab="",ylab="",bty="n",xaxt="n",yaxt="n",xaxs="i",yaxs="i",asp=1) > abline(h=c(0,14),lwd=2,col="grey") > abline(v=c(0,14),lwd=2,col="grey") > par(new=TRUE) > abline(h=seq(0,14,by=0.2),lty=3,col="grey") > abline(h=seq(0,14,by=1),lty=1,col="grey") > abline(v=seq(0,14,by=0.2),lty=3,col="grey") > abline(v=seq(0,14,by=1),lty=1,col="grey") > par(new=TRUE) > > only yaxs="i" is taken into account while xaxs="i" is ignored. When I remove > asp=1, xaxs="i" is activated again. > Small bug but kind of bothersome...!! > > Congratulations for the great work you guys are doing! > Fran?ois > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel