title: ggplot2: Why symbol sizes differ when 'size' is including inside vs outside aes statement?
body: <p>I have created quite a few maps using base-R but I am now trying to perform similar tasks using ggplot2 due to the ease by which multiple plots can be arranged on a single page. Basically, I am plotting the locations at which samples of a particular species of interest have been collected and want the symbol size to reflect the total weight of the species collected at that location. Creating the base map and various layers has not been an issue but I'm having trouble getting the symbol sizes and associated legend the way I want them. </p>
  
  <p>The problem is demonstrated in the workable example below. When I include 'size' outside of aes, the symbol sizes appear to be scaled appropriately (plot1). But when I put 'size' inside the aes statement (in order to get a legend) the symbol sizes are no longer correct (plot2). It looks like ggplot2 has rescaled the data. This should be a simple task so I am clearly missing something very basic. Any help understanding this would be appreciated.</p>
  
  <pre><code>library(ggplot2)
  
  #create a very simple dataset that includes locations and total weight of samples collected from each site
  catch.data&lt;-data.frame(long=c(-50,-52.5,-52,-54,-53.8,-52),
                         lat=c(48,54,54,55,52,50),
                         wt=c(2,38,3,4,25,122))
  
  #including 'size' outside of aes results in no legend
  #but the symbol sizes are represented correctly
  plot1&lt;-ggplot(catch.data,aes(x=long,y=lat)) +
    geom_point(size=catch.data$wt,colour="white",fill="blue",shape=21)    
  
  #including 'size' within aes appears necessary in order to create a legend
  #but the symbol sizes are not represented correctly
  plot2&lt;-ggplot(catch.data,aes(x=long,y=lat)) +
    geom_point(aes(size=catch.data$wt),colour="white",fill="blue",shape=21)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/tWqv1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tWqv1.jpg" alt="enter image description here"></a></p>