title: Changing the color in the legend with ggplot2 in R
body: <p>I'm having two different problems with specifying the colors in my legends in ggplot.  I've tried to make a simplified examples that shows my problem:</p>
  
  <pre><code>df &lt;- data.frame(x=rep(1:9, 10), y=as.vector(t(aaply(1:10, 1, .fun=function(x){x:(x+8)}))), method=factor(rep(1:9, each=10)), DE=factor(rep(1:9, each=10)))
  ggplot(df, aes(x, y, color=method, group=DE, linetype=DE)) + geom_smooth(stat="identity")
  </code></pre>
  
  <p>For some reason, the line types shown in the legend under the title DE are all blue.  I'd like them to be black, but I have no idea why they're blue in the first place, so I'm not sure how to change them.</p>
  
  <p>For my other problem, I'm trying to use both point color and point shape to show two different distinctions in my data.  I'd like to have legends for both of these.  Here's what I have:</p>
  
  <pre><code>classifiers &lt;- c("KNN", "RF", "NB", "LR", "Tree")
  des &lt;- c("Uniform", "Gaussian", "KDE")
  
  withoutDE &lt;- c(.735, .710, .706, .628, .614, .720, .713, .532, .523, .557, .677, .641, .398, .507, .538)
  withDE &lt;- c(.769, .762, .758, .702, .707, .752, .745, .655, .721, .733, .775, .772, .749, .756, .759)
  
  df &lt;- data.frame(WithoutDE=withoutDE, WithDE=withDE, DE=rep(des, each=5), Classifier=rep(classifiers, 3))
  df &lt;- cbind(df, Method=paste(df$DE, df$Classifier, sep=""))
  
  ggplot() + geom_point(data=df, aes(x=WithoutDE, y=WithDE, shape=Classifier, fill=DE), size=3) + ylim(0,1) + xlim(0,1) + xlab("AUC without DE") + ylab("AUC with DE") + scale_shape_manual(values=21:25) + scale_fill_manual(values=c("pink", "blue", "white"), labels=c("Uniform", "KDE", "Gaussian")) + theme(legend.position=c(.85,.3))
  </code></pre>
  
  <p>If I change the color to change as well as the fill (by putting color=DE into the aes), then those are visible in the legend.  I like having the black border around the points, though.  I'd just like to have the inside of the points in the legend reflect the point fill in the plot. (I'd also like to position the two legends side-by-side, but I really just want to get the color to work right now)</p>
  
  <p>I've spent way too long googling about both of these problems and trying various solutions without any success.  Does anyone have any idea what I'm doing wrong?</p>