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. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.