Histogram in R - x-axis not centered properly

后端 未结 3 1928

I have a histogram from a list d of values that I make by simply typing

hist(d)

And this is what I get:

3条回答
  •  不要未来只要你来
    2021-01-21 03:45

    Two suggestions:

    #See if this is sufficient:
    hist(...)
    box()
    
    #If not, try custom axes:
    hist(..., xlim = c(-.5, .5), axes = F)
    box()
    axis(1, seq(-.5, .5, length = 6))
    axis(2, seq(0, 30, by = 5))
    

提交回复
热议问题