[R] Colour gradients in ggtern

Ulrik Stervbo ulrik.stervbo at gmail.com
Tue Aug 2 17:00:16 CEST 2016

Hi Jake,

maybe you can just revet the colours given to the scale:

scale_colour_gradientn(colours = rev(rainbow(5.5)))


On Tue, 2 Aug 2016 at 16:41 Jake William Andrae <jake.andrae at adelaide.edu.au>

> Hello,
> This is my first time posting to the r-help mailing list and I'm a
> relative amateur using R, so forgive my naivety. I am constructing a
> ternary diagram using the ggtern extension of the ggplot package, and I'm
> having some trouble with the colour gradient I want it to display. I have
> attached the output plot, where a rainbow colour gradient can be seen, but
> I really need these colours to be in reverse order. This is the command I
> used to construct the plot;
> #Plot construction
> > ggtern(data= C27_C29_C31, aes(x=C27,y=C29,z=C31))+geom_point(aes(colour=
> GST),size=3)+theme_light()+theme_nogrid_minor()+scale_colour_gradientn(colours
> = rainbow(5.5))
> Is there a simple way to reverse the colours in the scale_colour_gradientn
> command?
> Kind regards,
> Jake Andrae
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

	[[alternative HTML version deleted]]

More information about the R-help mailing list