Skip to content
Back to formatted view

Raw Message

Message-ID: <CAKVAULNwvTb+Qv-4Ku2Ta8TDhoVn1_MBhCa=eMbk804GOm=s2w@mail.gmail.com>
Date: 2016-08-02T15:00:16Z
From: Ulrik Stervbo
Subject: Colour gradients in ggtern
In-Reply-To: <15E1D0623AFA794999C09BE1916D7A8C06BBA642@mailmb10.ad.adelaide.edu.au>

Hi Jake,

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

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

Best,
Ulrik

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

> 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]]