Skip to content

axis lines crossing at origin

2 messages · Liaw, Andy, Peter Dalgaard

#
You probably want something like:

plot(x,sin(x), xaxt="n", yaxt="n")
axis(1, pos=0)
axis(2, pos=0)

... but note that axis() only draws the axes from the minimum tick to the
maximum tick.  You may still want to add:

abline(v=0, h=0)

HTH,
Andy
#
"Liaw, Andy" <andy_liaw at merck.com> writes:
Also, you generally don't want to have a tick mark at the origin since
the other axis would go straight through the label, so you should
learn about the at= argument to axis() too.