【问题标题】:Set the intervals of x-axis using r使用 r 设置 x 轴的间隔
【发布时间】:2013-03-30 18:41:31
【问题描述】:

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

【问题讨论】:

    标签: r plot


    【解决方案1】:

    你可以使用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()
    

    【讨论】:

      猜你喜欢
      • 2017-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-13
      • 1970-01-01
      • 1970-01-01
      • 2017-09-04
      相关资源
      最近更新 更多