[R] graphical parameters in plot

Ben Bolker ben at zoo.ufl.edu
Fri Jun 2 21:51:29 CEST 2000


  Well, my last attempt to answer a question about plot() parameters was
wrong (sorry Dr. Ripley), but I'll try again.

  I'm not sure, but I would hazard a guess that your problem is that you
haven't specified your x- and y-limits and that your data don't cover the
range of the axis ranges you want.  What are the x- and y-ranges of your
data?

  I would try something along these lines:

plot(...,xlim=c(-2.4,-2.2),ylim=c(-2500,10000),axes=FALSE)
axis(1,seq(-2.4,-2.2,length=5)
axis(2,seq(-2500,10000,length=6),cex.axis=0.9)

  hope that helps

On Fri, 2 Jun 2000, Angelo Canty wrote:

> I'm using plot to make a simple plot but I want to control where
> the tick marks go on bot axes.  The graphical parameters xaxp and
> yaxp seem to be ignored by the plot function so I tried setting them
> using
> op <- par(no.readonly=T)
> par(xaxp=c(-2.4,-2.2,5), yaxp=c(-2500,10000,6))
> plot(...)
> par(op)
> but they are still ignored.
> 
> Next I tried to use the axis function as follows
> op <- par(no.readonly=T)
> par(xaxt="n", yaxt="n")
> plot(...)
> axis(1,seq(-2.4,-2.2,length=5))
> axis(2,seq(-2500,10000,length=6), cex.axis=0.9)
> par(op)
> but no axis labels are plotted.
> 
> Moving par(op) before the calls to axis causes the first call to axis to
> extend the x-axis to the edge of the screen and the second call results
> in a 0 being placed at the bottom of the y-axis.  
> 
> Is this a bug or is it just that it's Friday afternoon?  In any case
> can someone please help me out here.
> 
> I'm using the following verison of R
> platform sparc-sun-solaris2.6
> arch     sparc               
> os       solaris2.6          
> system   sparc, solaris2.6   
> status                       
> major    1                   
> minor    0.0                 
> year     2000                
> month    February            
> day      29                  
> language R                   
> 
> Angelo
> 
> 
> 

-- 
Ben Bolker                                  bolker at zoo.ufl.edu
Zoology Department, University of Florida   http://www.zoo.ufl.edu/bolker
318 Carr Hall/Box 118525                    tel: (352) 392-5697
Gainesville, FL 32611-8525                  fax: (352) 392-3704

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