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
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(
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
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"
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.
__
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
> Subject: [R] ggplot incorrect
6 matches
Mail list logo