Density function plot not really vertical - ggplot2
<p>I am plotting a density function with the <code>ggplot2</code> package. I noticed that the first and second vertical line are not perfectly rectangular, although as far as I understand they should be, or? I also found this to be the case, when plotting a distribution of the binomial distribution that the the steps are not really rectangular.</p>

<pre><code>library(ggplot2)
p_uniform_density &lt;- ggplot(data.frame(x = c(-2, 17.5)), aes(x)) + 
stat_function(fun = dunif, args = list(min = 0, max = 15), size=1.2 ) +
theme_bw() +
labs(y = "f(X)", x = "X") +
theme(text = element_text(size=20) ,  panel.grid.major = element_line(size = 0.2, linetype = 'solid', colour = "grey"), 
    panel.grid.minor = element_line(size = 0.1, linetype = 'solid', colour = "grey")) +
scale_x_continuous( breaks = c(-2:17.5))
</code></pre>

<p><a href="https://i.stack.imgur.com/TgZxr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TgZxr.png" alt="Density plot with skewed start and end values"></a></p>