title: Changing legend names without changing colors in ggplot2
body: <p>I would like to rename the values in a legend without altering the custom colors that have already been set. Is there a way to set legend labels without using scale_color_manual? Currently, I have something like this:</p>
  
  <pre><code>norm &lt;- rnorm(1000, 0 , .5)
  gam &lt;- rgamma(1000, 2)
  beta &lt;- rbeta(1000, 2, 3)
  dist &lt;- data.frame(Normal = norm, Gamma = gam, Beta= beta)
  dat &lt;- melt(dist, variable.name = "Distribution", value.name = "XValue")
  plot1 &lt;- ggplot(dat, aes(XValue, color = Distribution)) +
              stat_density(geom = "path", position = "identity", size = 2) +
              scale_color_manual(values = c("yellow", "black", "forestgreen"))
  
  plot2 &lt;- plot1 + scale_color_discrete(labels = c("Distribution 1",
                                  "Distribution 2",
                              "Distribution 3"))
  </code></pre>
  
  <p>This however overwrites the manual colors. I will be changing the names in a different function from where I am setting colors so, unfortunately, I will not be able to use scale_color_manual( values =... , labels = ...). The other option I thought of is to somehow get the colors used in plot1. I could then do something like:</p>
  
  <pre><code>colors &lt;- plot1$colors_used
  plot2 &lt;- plot1 + scale_color_manual(labels = c("Distribution 1", 
                                                 "Distribution 2",
                          "Distribution 3"),
                                        values = colors)
  </code></pre>
  
  <p>Any help would be much appreciated. Thanks!</p>