Re: [R] ggplot incorrect legend

2012-06-09 Thread John Kane
t;Energy\nSources", breaks=c("1", "2", "4", "5"), labels=c("biomass", "coal", "gas", "hydro")) p John Kane Kingston ON Canada > -Original Message- > From: ja...@crosb.ie > S

Re: [R] ggplot incorrect legend

2012-06-08 Thread jcrosbie
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(

Re: [R] ggplot incorrect legend

2012-06-06 Thread John Kane
al Message- > From: ja...@crosb.ie > Sent: Wed, 6 Jun 2012 09:29:24 -0700 (PDT) > To: r-help@r-project.org > Subject: Re: [R] ggplot incorrect legend > > Thank you for your help. > > I would expect FuelTypeNum to make up the legend. But in the legend > there > i

Re: [R] ggplot incorrect legend

2012-06-06 Thread jcrosbie
Thank you for your help. I would expect FuelTypeNum to make up the legend. But in the legend there is an extra value of called '3' and in the chart there is an extra FuelTypeNum. code: ggplot(data=tempTable, aes(x=Bands8, y=AvailableMWNewFormat, fill=FuelTypeNum)) + geom_bar(position="stack"

Re: [R] ggplot incorrect legend

2012-06-06 Thread jcrosbie
I'm expecting the legend to be 1,2,4,5,10 not 2,4,6,8,10. Is there away I can set my own colour and legend tittles? -- View this message in context: http://r.789695.n4.nabble.com/ggplot-incorrect-legend-tp4632471p4632529.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] ggplot incorrect legend

2012-06-06 Thread John Kane
You are from the jpeg you link as far as I can see.. What exactly is the output that you expect in the legend John Kane Kingston ON Canada > -Original Message- > From: ja...@crosb.ie > Sent: Tue, 5 Jun 2012 20:18:55 -0700 (PDT) > To: r-help@r-project.org > Subj

[R] ggplot incorrect legend

2012-06-05 Thread jcrosbie
How do I create a legend with ggplot? I think should be getting the FuelTypeNum in the legend. Plot: http://r.789695.n4.nabble.com/file/n4632471/Rplot.jpeg My code is: ggplot(data=tempTable, aes(x=Bands8, y=SubPercent, fill=FuelTypeNum)) + geom_bar(position="stack", stat="identity") + scal