[R] ggplot incorrect legend

jcrosbie james at crosb.ie
Fri Jun 8 19:29:11 CEST 2012


Thank you, that was very helpful. 

Would it be possible to rename the legend values as well. Example 1 as
Biomass, 2 as coal, 4 as gas, 5 as hydro?

ggplot(data=tempTable, aes(x=Bands8, y=AvailableMWNewFormat,
fill=as.factor(FuelTypeNum))) +
  geom_bar(position="stack", stat="identity")+
  guides(fill = guide_legend(title = "Fuel Type", title.position = "top"))+
  xlab( "Price Bands")+
  ylab("Available MW") 

--
View this message in context: http://r.789695.n4.nabble.com/ggplot-incorrect-legend-tp4632471p4632843.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list