[R] setting xlim and ylim with asp=1

Angel angel_lul at hotmail.com
Mon Aug 25 11:44:11 CEST 2003


In plot(), when using option asp=1 the xlim and ylim have no effect because
they are changed
changed in order to fill the whole plot region. Is there a way to
automatically set
xlim and ylim when asp has been set to 1?
For example:
#This is a box of the plot ranges I want:
boxxy=rbind(c(-1,2),c(-1,-1),c(1,-1),c(1,2),c(-1,2))
#Without asp=1 I get what I want (i.e. I can't see the box because it
#overlays with the axis
plot(boxxy,type="l",xaxs="i",yaxs="i",xlim=c(-1,1), ylim=c(-1,2))
# When I add asp=1 I can see the box
plot(boxxy,type="l",xaxs="i",yaxs="i",xlim=c(-1,1), ylim=c(-1,2),asp=1)

Thanks for any help,
Angel




More information about the R-help mailing list