title: How to add legend in a ggplot2 bar chart
body: <p>I am trying to design a nice graph in ggplot2 by using bars to show different values for some periods. I got the graphic but I can't add the legend in the rigth side of the graph. My dataframe <code>DF</code> has 3 variables <code>Month,variable,value</code>. These variables are the result of <code>melt()</code> function in another data (I add the <code>dput()</code> version  of <code>DF</code> in the final part). So, my dataframe <code>DF</code> looks like this:</p>
  
  <pre><code>   Month variable     value
  1     m2    Power 1258978.9
  2     m3    Power 1608317.4
  3     m4    Power 1293821.1
  4     m5    Power 1819283.8
  5     m6    Power 1436552.9
  6     m7    Power  875170.3
  7     m8    Power 1315856.2
  8     m9    Power  710004.3
  9    m10    Power  889398.1
  10   m11    Power 1114883.1
  11   m12    Power 1419242.1
  12   m13    Power 1585857.2
  13   m14    Power 1010455.6
  14   m15    Power 1292333.4
  </code></pre>
  
  <p>To show the evolution of <code>value</code> variable by <code>month</code> I used this </p>
  
  <pre class="lang-r prettyprint-override"><code>library(ggplot2)
  library(scales)
  ggplot(DF, aes(x=Month, y=value))
      +geom_bar(position="identity",fill="#FF6C91",colour="black",size=1)
      +scale_y_continuous(
          labels=comma,
          breaks=pretty_breaks(n=7),
          limits=c(0,max(DF$value,na.rm=T))
      )
      +theme(
          axis.text.x=element_text(angle=90,colour="grey20",face="bold",size=12),
          axis.text.y=element_text(colour="grey20",face="bold",hjust=1,vjust=0.8,size=15),
          axis.title.x=element_text(colour="grey20",face="bold",size=16),
          axis.title.y=element_text(colour="grey20",face="bold",size=16)
      )
      +xlab('Month')
      +ylab('')
      +ggtitle("My graph")
      +theme(plot.title = element_text(lineheight=3, face="bold", color="black",size=24))
      +theme(legend.text=element_text(size=14),legend.title=element_text(size=14))
  </code></pre>
  
  <p>With this code I got the next graphic:
  <img src="https://i.stack.imgur.com/bUQ2o.jpg" alt="enter image description here"></p>
  
  <p>The result is almost perfect but I don't know how to add the legend in the right side of the graph with the same color of bars to give more information in this image. I have tried to add <code>fill</code> argument inside <code>geom_bar</code> but I can't get my wished result. The <code>dput()</code> version of <code>DF</code> is the next:</p>
  
  <pre><code>DF=structure(list(Month = c("m2", "m3", "m4", "m5", "m6", "m7", 
  "m8", "m9", "m10", "m11", "m12", "m13", "m14", "m15"), variable = structure(c(1L, 
  1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "Power", class = "factor"), 
      value = c(1258978.86, 1608317.42, 1293821.14, 1819283.78, 
      1436552.93, 875170.34, 1315856.24, 710004.35, 889398.08, 
      1114883.11, 1419242.11, 1585857.22, 1010455.56, 1292333.35
      )), .Names = c("Month", "variable", "value"), row.names = c(NA, 
  -14L), class = "data.frame")
  </code></pre>
  
  <p>Many thanks for your help.</p>