title: Is it possible to remove space in histogram with many bins?
body: <p>I am plotting a histogram with many bins (1000+).  Code is below:</p>
  
  <pre><code>library(tidyverse)
  xx=rpois(1000,lambda = 40)
  y=density(xx,n=1000,from=0)
  
  ggplot(data.frame(x = y$x, y = y$y), aes(x, y)) + 
    geom_line() + 
    geom_histogram(stat='identity',aes(fill=y))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/0geZo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0geZo.png" alt="enter image description here"></a></p>
  
  <p>As you can see, it is adding unwanted spacing in between my bars (I would like a seamless gradient).  Is there a way to remove these spaces?  For reference, I am aware of the way to use <code>geom_segment</code> to achieve these results so for right now I am only interested in fixing the histogram issue (if possible).  Setting <code>color=y</code> inside the <code>aes</code> works but my larger goal here is a hacky code that lets me essentially graph two density curves with two completely separate gradients (thus I need to save my <code>geom_segment</code> and <code>color</code> for the other density curve). </p>
  
  <p>Thanks!</p>