Skip to content
Prev 131096 / 398506 Next

ggplot2: Choosing colours

Dear Domenico,

It looks like my question wasn't very clear. I want to specify the
colours meself. Colour = z will use default colours and I'd like to
change those. I need to change them into red, green, blue and black
instead of pink, brown, green and blue.

The solution should have the layout of:

ggplot(data = dataset, aes(x = x, y = y, colour = z)) + geom_point()

But the colours of:

ggplot(data = dataset, aes(x = x, y = y, group = z)) + geom_point(colour
= c("red", "green", "blue", "black"))


Cheers,

Thierry


------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium 
tel. + 32 54/436 185
Thierry.Onkelinx op inbo.be 
www.inbo.be 

Do not put your faith in what statistics say until you have carefully
considered what they do not say.  ~William W. Watt
A statistical analysis, properly conducted, is a delicate dissection of
uncertainties, a surgery of suppositions. ~M.J.Moroney

-----Oorspronkelijk bericht-----
Van: Domenico Vistocco [mailto:vistocco op unicas.it] 
Verzonden: maandag 3 december 2007 14:08
Aan: ONKELINX, Thierry
CC: r-help op r-project.org
Onderwerp: Re: [R] ggplot2: Choosing colours

qplot(data=dataset, x, y, colour=z)
ONKELINX, Thierry wrote:
labels
geom_point(colour
------------------------------------------------------------------------
of
http://www.R-project.org/posting-guide.html