The numbers on the corner of their bar in the histogram, how can I get them centered under the bar?
I am plotting a histogram with the hist standard function with this example dataset:
v= c(0L, 0L, 0L, 1L,1L,1L,2L, 2L, 2L,4L, 4L, 4L)
hist(v, main='example', xlab='example', ylab='example', breaks=5)
The problem I am facing is that the image with histogram looks like this:
| ___
|| |
|| |___ ___
|| | | | |
||___|___|___|___|
0 1 2 3 4
So, because 0 starts at a corner, the combinations of 0 and 1 are merged, and panel 2 and 4 looks like it belongs to 1 and 2, 3 and 4. What I want to have is
|
|
| ___ ___ ___ ___
|| | | | | |
||___|___|___|___|___|
0 1 2 3 4
I tried to change the breaks, but that doesn't solve the problem of the numbers on the corner. How can I get the numbers to be centered under the bars?
+3
source to share