title: ggplot: combining size and color in legend
body: <p>I've only very recently started learning R. Now what I'm trying to do is to integrate two legends for the same plot. In other words, I want the default size legend to change color depending on it's size.</p>
  
  <p>I have been Googling several solutions that apparently all don't seem to work, but again, I'm new to R so maybe I'm just doing something wrong.</p>
  
  <p>My code:</p>
  
  <pre><code>ggplot(Caschool, aes(x=testscr, y=avginc), colour="green") +
    geom_point(aes(size=enrltot, color=enrltot)) +
    geom_smooth(colour="blue") +
    labs(x="Test Score", y="Average Income", title="California Test Score Data", color="Number of Students\nPer District") +
    theme(
      panel.grid.minor = element_blank(), 
      panel.grid.major=element_line(colour="grey", size=0.4), 
      panel.background=element_rect(fill="beige"), 
      axis.line=element_line(size = 1.2, colour = "black"),
      plot.title = element_text(size = rel(2))) +
    scale_color_continuous(limits=c(0, 30000), breaks=seq(0,30000, by=2500)) +
    guides(color= guide_legend(), size=guide_legend())
  </code></pre>
  
  <p>Apparently, I'm not allowed to post pictures, or I would have shown what this looks like so far.</p>