I am bewildered by the behaviour of tickmarks as demonstrated by the
following code. (What I'm trying to do is draw a single tick mark
extending
from the axis all the way down to the tick label, which is two lines
from
the axis to make sure it doesn't overlap with the ``ordinary'' tick
labels.)
# Try 1:
# Gap between tickmark and label.
plot(1:10)
axis(side = 1, at = 2.35, labels = "2.35", tick = TRUE,
tcl=1,line=1,col="red", col.axis = "red")
readline('Go? ')
# Try 2:
# Gap between tickmark and axis.
plot(1:10)
axis(side = 1, at = 2.35, labels = "2.35", tick = TRUE,
tcl=-1,line=1,col="red", col.axis = "red")
readline('Go? ')
# Try 3:
# Gap between tickmark and label not filled.
plot(1:10)
axis(side = 1, at = 2.35, labels = "2.35", tick = TRUE,
tcl=1,line=1,col="red", col.axis = "red")
axis(side = 1, at = 2.35, labels ="", tick = TRUE,
tcl=-1,col="red")
readline('Go? ')
# Try 4:
# Gap between tickmark and label ***is*** filled.
# Gives what I want, but ***why***?
plot(1:10)
axis(side = 1, at = 2.35, labels = "2.35", tick = TRUE,
tcl=-1,line=1,col="red", col.axis = "red")
axis(side = 1, at = 2.35, labels ="", tick = TRUE,
tcl=-1,col="red")
What I can't understand is why the tcl value in the second call to
axis() seems
to have the opposite effect of its value in the first call to axis().
Can anyone enlighten me?
BTW setting tcl=2 and tcl=-2 have impacts which also bewilder me and
do not
have the desired effect.
cheers,
Rolf Turner
P. S. Version info:
> version
_
platform i386-apple-darwin8.10.1
arch i386
os darwin8.10.1
system i386, darwin8.10.1
status
major 2
minor 6.0
year 2007
month 10
day 03
svn rev 43063
language R
version.string R version 2.6.0 (2007-10-03)
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
Well, let me have a crack at it ... (inline below)
Bert Gunter
Genentech Nonclinical Statistics
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On
Behalf Of Rolf Turner
Sent: Monday, November 12, 2007 2:16 PM
To: r-help at r-project.org
Subject: [R] Tick mark puzzle.
I am bewildered by the behaviour of tickmarks as demonstrated by the
following code. (What I'm trying to do is draw a single tick mark
extending
from the axis all the way down to the tick label, which is two lines
from
the axis to make sure it doesn't overlap with the ``ordinary'' tick
labels.)
# Try 1:
# Gap between tickmark and label.
plot(1:10)
axis(side = 1, at = 2.35, labels = "2.35", tick = TRUE,
tcl=1,line=1,col="red", col.axis = "red")
readline('Go? ')
## From the first line position, below the plotting region (line =1) the
tick mark is
## drawn up 1 line height of text to the 0 position at the edge of the
plotting region
## The label is drawn below the line =1 position, leaving the gap
# Try 2:
# Gap between tickmark and axis.
plot(1:10)
axis(side = 1, at = 2.35, labels = "2.35", tick = TRUE,
tcl=-1,line=1,col="red", col.axis = "red")
readline('Go? ')
## From the first line position one line height below the graph the tick
mark is drawn down to where
## the label is located, leaving the gap between tick mark and graph
boundary.
# Try 3:
# Gap between tickmark and label not filled.
plot(1:10)
axis(side = 1, at = 2.35, labels = "2.35", tick = TRUE,
tcl=1,line=1,col="red", col.axis = "red")
axis(side = 1, at = 2.35, labels ="", tick = TRUE,
tcl=-1,col="red")
readline('Go? ')
## First axis command as in Try 1. Second command uses default line = 0 edge of
plot region
## and so redraws tick the "other way" (down instead of up; try the
second
axis it in a different ## color and you'll see it overplot the tick in the
different color)
# Try 4:
# Gap between tickmark and label ***is*** filled.
# Gives what I want, but ***why***?
plot(1:10)
axis(side = 1, at = 2.35, labels = "2.35", tick = TRUE,
tcl=-1,line=1,col="red", col.axis = "red")
axis(side = 1, at = 2.35, labels ="", tick = TRUE,
tcl=-1,col="red")
## Well you should be able to figure this one out now, right ... ;-)
Cheers,
Bert
Apparently Analagous Threads
- Can't Get Lattice Histogram Minor Tick Marks to Work
- Ticks on barplots
- Can't Get Lattice Histogram Minor Tick Marks to Work
- Can't Get Lattice Histogram Minor Tick Marks to Work
- Can someone please explain why the last tick mark on this chart is not showing?