title: Specifying exact bin range in geom_histogram
body: <p>I have a data set with events happening at a certain time of the day. I'd like to make a histogram of events per hour. I looked up 
  <a href="https://stackoverflow.com/questions/25146544/r-emulate-the-default-behavior-of-hist-with-ggplot2-for-bin-width">R - emulate the default behavior of hist() with ggplot2 for bin width</a>
  and
  <a href="https://stackoverflow.com/questions/32102608/r-hist-vs-geom-hist-break-points">R hist vs geom_hist break points</a>
  which brougt me this far, but this is still not what I want. I tried this:</p>
  
  <pre><code>library(ggplot2)
  set.seed(1)
  df1 = data.frame(t=as.integer(rnorm(100, 25, 8)) / 2) %% 24
  ggplot(data=df1, aes(x=t)) +
    geom_histogram(binwidth=1, colour="steelblue4", fill="steelblue") +
    stat_bin(binwidth = 1, aes(label=..count..), vjust=-0.5, geom = "text") +
    scale_x_continuous("Time",
      breaks=seq(0, 23, by=4),
      labels=c("00:00", "04:00", "08:00", "12:00", "16:00", "20:00")) +
    scale_y_continuous(breaks = 0:15)
  </code></pre>
  
  <p>and got this image:</p>
  
  <p><a href="https://i.stack.imgur.com/lOywq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lOywq.png" alt="Incorrect histogram"></a></p>
  
  <p>This histogram is 1) incorrect and 2) not showing what I want. The histogram gives the impression that there are two events at (or around) 04:00. When we look at the data, wee see that there is an event at 3.5 (i.e. 03:30) and at 4.5 (04:30). What I'd actually want is the histogram showing the number of events in the range [00:00, 01:00), [01:00, 02:00) ... [23:00, 24:00). The event at 03:30 should be assigned to a different bin than the event at 04:30. Also, I'd like the histogram to span the whole day, from 00:00 to 24:00. Something like this (photoshopped!):</p>
  
  <p><a href="https://i.stack.imgur.com/YfRCi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YfRCi.png" alt="Better histogram, manually adjusted"></a></p>
  
  <p>which is congruent with </p>
  
  <pre><code>Time &lt;- cut(df1$t, breaks = 0:24, dig.lab = 4, right = FALSE) 
  as.data.frame(table(Time))
  
        Time Freq
  1    [0,1)    0
  2    [1,2)    0
  3    [2,3)    0
  4    [3,4)    1
  5    [4,5)    1
  6    [5,6)    1
  7    [6,7)    3
  8    [7,8)    4
  9    [8,9)    2
  10  [9,10)    7
  11 [10,11)   11
  12 [11,12)    8
  13 [12,13)   12
  14 [13,14)   10
  15 [14,15)   14
  16 [15,16)    8
  17 [16,17)    6
  18 [17,18)    4
  19 [18,19)    5
  20 [19,20)    0
  21 [20,21)    1
  22 [21,22)    1
  23 [22,23)    1
  24 [23,24)    0
  </code></pre>
  
  <p>Is this possible at all using geom_histogram() and, if not, what else should I use?</p>