[R] plot with the axes at xlim and ylim

Arnold Kester arnold.kester at stat.unimaas.nl
Tue Mar 19 11:55:21 CET 2002


I'd like to make a plot with the axes drawn at the values of xlim and
ylim. The default plot draws the axes slightly outside these values. I
have been experimenting with the par(mgp) setting, but specifying
par(mgp=c(2,0,-1)) gives me 

"invalid value specified for graphics parameter "mgp".".

A more complicated mathod that almost seems to work is doing the plot
with "axes=F" and then adding the axes with "axis" statements:

xlim <- c(0,10)
ylim <- c(0,11)
plot(c(1:9),c(1:9),axes=F,xlim=xlim,ylim=ylim)
axis(1,pos=ylim[1])
axis(2,pos=xlim[1])
axis(3,pos=ylim[2],labels=F)
axis(4,pos=xlim[2],labels=F)

The problem here is that the vertical axes are not long enough. 

Is there an easier way to get what I want?

Thanks,
Arnold Kester 
 
-- 
Met vriendelijke groet,
Arnold Kester

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list