底部有多个轴

Cod*_*Guy 3 plot axis r

我正在尝试在R的底图上放置一个轴在底部x轴下方.目前,我有一个轴如下:

axis(side=1, col="blue")
Run Code Online (Sandbox Code Playgroud)

现在我想在那个下面添加另一个轴,具有不同的值.我怎样才能做到这一点?

DQd*_*dlM 6

我认为这就是你要找的东西:

这里的关键是axis线.该at指示哪个标记处放置标签和label说什么来调用核对符号.

x <- sample(1:100, 10, replace = T) # just 10 random numbers
y <- sample(1:100, 10, replace = T) # 10 more random numbers
par(mar = c(10, 5, 5, 5)) 
    # increasing the 1st number to 10 makes 10 lines below axis 1
plot(x~y) # normal plot
axis(1, at = c(20, 40, 60, 80), labels = c("1", "2", "3", "4"), line = 5, col = 4) 
    # the "line" indicates which of the 10 lines made above to put the axis on
Run Code Online (Sandbox Code Playgroud)