From murdoch at stats.uwo.ca  Sun Jun 18 09:44:38 2006
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Sun, 18 Jun 2006 03:44:38 -0400
Subject: [Rd] Axis line not appearing with axis(tick=FALSE) (PR#8998)
In-Reply-To: <20060617222552.84CCECD3F@slim.kubism.ku.dk>
References: <20060617222552.84CCECD3F@slim.kubism.ku.dk>
Message-ID: <44950466.40304@stats.uwo.ca>

sean.pieper at gmail.com wrote:
> Full_Name: Sean Pieper
> Version: 2.3.1
> OS: Windows
> Submission from: (NULL) (67.188.92.37)
>
>
> Hi, I am trying to create a qualitative figure for which I don't want tick marks
> or numbers, but having some axes would be nice.
>
> If I do: 
>
> plot.new()
> axis(2,labels=FALSE,tick=FALSE,lty="solid",lwd=1)
>
> I expect this should give me a vertical line on the left edge of the plot, but
> nothing draws. When I run:
>
> axis(2,labels=FALSE,tick=TRUE,lty="solid",lwd=1)
>
> both the line and the ticks draw 
>
> If I type:
>
> axis(2,labels=TRUE,tick=FALSE,lty="solid",lwd=1)
>
> I get numbers, but still no axis line. 
>
> I also checked with axis(1,...) and saw the same behavior.

I don't think this is a bug, just the way it is designed.  Normally axis 
only draws the line between the extreme ticks, not for the
whole length of the axis.  If you have no tick, you have no line.

You might get what you want with box(), or by drawing the axes using 
abline(), e.g.

 abline(v=par("usr")[1])

for a vertical line at the lower limit of x values.  As ?par says, 
par("usr") is:

A vector of the form c(x1, x2, y1, y2) giving the extremes of the user 
coordinates of the plotting region. When a logarithmic scale is in use 
(i.e., par("xlog") is true, see below), then the x-limits will be 10 ^ 
par("usr")[1:2]. Similarly for the y-axis.

Duncan Murdoch



[Rd] Axis line not appearing with axis(tick=FALSE) (PR#8998)
Duncan Murdoch