簡體   English   中英

使用r設置x軸的間隔

[英]Set the intervals of x-axis using r

我繪制了一個景點的訪問時間分布,從一天0到23小時。 我想調整x軸的間隔,讓所有小時都顯示出來。 我怎樣才能做到這一點?

d = c(42,13,10,3,2,6,7,15,38,63,128,153,178,181,236,217,272,417,526,653,607,385,191,70)
plot(seq(0,23,by=1),c,type='b',col='red',main="Confucius Temple",xlab="Hours",ylab="Numbers of check-in")

在此輸入圖像描述

你可以使用axis

> axis(side=1, at=c(0:23))

就是這樣的:

plot(0:23, d, type='b', axes=FALSE)
axis(side=1, at=c(0:23))
axis(side=2, at=seq(0, 600, by=100))
box()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM