Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Put tick labels of only x-axis inside plotting area

Tags:

plot

r

Is it possible to put tick labels of only x-axis inside plotting area? I am trying:

axis(1,at=c(0:71),c(rep(0:23,3)),cex.axis=.7, font=1,tck=.01)

It seems that:

par(mgp=c(0,-1.4, 0)) 

puts both x and y tick labels inside plotting area.

like image 359
Mitra Rahmati Avatar asked Oct 26 '15 10:10

Mitra Rahmati


1 Answers

Why don't you just draw the ticks where you want them using the pos argument to axis():

plot(0:72, xaxt="n")
text(0:71, -1, rep(0:23, 3), cex = 0.5)
axis(1, at=c(0:71), NA, cex.axis=.7, font=1, tck=.01)

enter image description here

like image 163
Thomas Avatar answered Oct 05 '22 23:10

Thomas