How to show more bubble sizes in legend of ggplot?
<p>I am trying to plot a bubble plot using ggplot with different sized dots based on a vector of values. It works as it should with this code</p>

<pre><code>ggplot(example, aes(x=x, y=y)) +
  geom_point(aes(size=size))
</code></pre>

<p>However, the sample size legend only shows two values that are on the higher end of the size spectrum, even though in the example of <a href="http://docs.ggplot2.org/current/geom_point.html" rel="noreferrer">http://docs.ggplot2.org/current/geom_point.html</a> it shows 4 dot sizes by default. I want to have a wider range of dot sizes in the legend. </p>

<p>I tried it with </p>

<pre><code>example$size_bin &lt;- cut(example$size, breaks = c(0,1000,5000,10000,50000,100000,300000),
                               labels=c("0-1000","1000-5000","5000-10000","10000-50000","50000-100000","&gt;100000"))
ggplot(example, aes(x=x, y=y)) +
  geom_point(aes(size=size_bin))
</code></pre>

<p>but because this is not a continuous scale this does not work. How can I change the legend so that  there are more sizes shown?</p>

<p><a href="https://i.stack.imgur.com/56UPi.png" rel="noreferrer"><img src="https://i.stack.imgur.com/56UPi.png" alt="enter image description here"></a></p>