title: Plot multiple histograms in one using ggplot2 in R
body: <p>I am fairly new to R and ggplot2 and am having some trouble plotting multiple variables in the same histogram plot.</p>
  
  <p>My data is already grouped and just needs to be plotted. The data is by week and I need to plot the number for each category (A, B, C and D).</p>
  
  <pre><code>Date          A    B    C    D
  01-01-2011    11   0    11   1
  08-01-2011    12   0    3    3
  15-01-2011    9    0    2    6
  </code></pre>
  
  <p>I want the Dates as the x axis and the counts plotted as different colors according to a generic y axis.
  I am able to plot just one of the categories at a time, but am not able to find an example like mine.</p>
  
  <p>This is what I use to plot one category. I am pretty sure I need to use <code>position="dodge"</code> to plot multiple as I don't want it to be stacked.</p>
  
  <pre><code>ggplot(df, aes(x=Date, y=A)) + geom_histogram(stat="identity") + 
  labs(title = "Number in Category A") +
  ylab("Number") + 
  xlab("Date") +
  theme(axis.text.x = element_text(angle = 90))
  </code></pre>
  
  <p>Also, this gives me a histogram with spaces in between the bars. Is there any way to remove this? I tried <code>spaces=0</code> as you would do when plotting bar graphs, but it didn't seem to work.</p>
  
  <p>I read some previous questions similar to mine, but the data was in a different format and I couldn't adapt it to fit my data.
  This is some of the help I looked at:</p>
  
  <p><a href="https://stackoverflow.com/questions/17879642/creating-a-histogram-with-multiple-data-series-using-multhist-in-r?rq=1">Creating a histogram with multiple data series using multhist in R</a></p>
  
  <p><a href="http://www.cookbook-r.com/Graphs/Plotting_distributions_%28ggplot2%29/" rel="nofollow noreferrer">http://www.cookbook-r.com/Graphs/Plotting_distributions_%28ggplot2%29/</a></p>
  
  <p>I'm also not quite sure what the bin width is. I think it is how the data should be spaced or grouped, which doesn't apply to my question since it is already grouped. Please advise me if I am wrong about this.</p>
  
  <p>Any help would be appreciated.
  Thanks in advance!</p>