--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
Learn to use factors. That will make things much easier
library(ggplot2)
data <-
data.frame(Corpus=factor(c(1,2,1,2,1,2)),f1=c(70,75,80,84,90,95),x=facto
r(c(1,1,2,2,3,3), labels = c("100k", "200k", "b100k")))
ggplot(data,aes(fill=Corpus,y=f1,x=x)) +
geom_bar(position="dodge", stat="identity")
Use scale to tweak the content of the legend
ggplot(data,aes(fill=Corpus,y=f1,x=x)) +
geom_bar(position="dodge", stat="identity") +
scale_fill_manual("Other title", value = c("purple",
"white"), labels = c("A", "B"), breaks = 1:2)
More examples at the ggplot2 website
Thierry
------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium
Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry....@inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey
> -----Oorspronkelijk bericht-----
> Van: ggp...@googlegroups.com
> [mailto:ggp...@googlegroups.com] Namens thomas
> Verzonden: dinsdag 21 september 2010 16:07
> Aan: ggplot2
> Onderwerp: Adjust legend
> --
> You received this message because you are subscribed to the
> ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
Druk dit bericht a.u.b. niet onnodig af.
Please do not print this message unnecessarily.
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in this message
and any annex are purely those of the writer and may not be regarded as stating
an official position of INBO, as long as the message is not confirmed by a duly
signed document.
More options: http://groups.google.com/group/ggplot2
----------------------------------------------------------------------------
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium
Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry....@inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
> -----Oorspronkelijk bericht-----
> Van: ggp...@googlegroups.com
> [mailto:ggp...@googlegroups.com] Namens thomas
> Verzonden: dinsdag 21 september 2010 16:26
> Aan: ggplot2
> Onderwerp: Re: Adjust legend
> ggplot2+u...@googlegroups.com<ggplot2%2Bunsubscribe@googlegro
> > > ups.com > More options:http://groups.google.com/group/ggplot2
>
> --
> You received this message because you are subscribed to the
> ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
Thomas
Brandon
> More options: http://groups.google.com/group/ggplot2
>