gpt4 book ai didi

r - 使用 r 设置 x 轴的间隔

转载 作者:行者123 更新时间:2023-12-02 02:44:51 35 4
gpt4 key购买 nike

我绘制了一个景点一天中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")

enter image description here

最佳答案

您可以使用:

> 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()

关于r - 使用 r 设置 x 轴的间隔,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15717545/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com