[R] Colour gradients in ggtern

Jake William Andrae jake.andrae at adelaide.edu.au
Tue Aug 2 05:02:03 CEST 2016


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: C27,C29,C31 GST.png
Type: image/png
Size: 8748 bytes
Desc: C27,C29,C31 GST.png
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20160802/2d080638/attachment.png>

More information about the R-help mailing list