[R] different coloured axis title labels for different axes
wdunlap at tibco.com
Mon Jan 11 19:54:20 CET 2016
The following shows how to get different colors for most features of a
title(xlab="X Axis Label", col.lab="light blue")
title(ylab="Y Axis Label", col.lab="light green")
axis(side=1, at=c(2,3,5,7,11), lab=as.expression(lapply(1:5,
function(i)bquote(pi[.(i)]))), col.axis="red", col="orange")
axis(side=2, at=log(c(2,3,5,7,11)), lab=as.expression(lapply(1:5,
function(i)bquote(lambda[.(i)]))), col.axis="blue", col="green")
title(main="Main Title", col.main="magenta", sub="(subtitle)",
See help(par) for details. The 'cex' and 'font' parameters have same
subtypes as 'col'.
On Mon, Jan 11, 2016 at 7:44 AM, Evan Cooch <evan.cooch at gmail.com> wrote:
> Consider a simple plot of X vs Y. There are elements on the plot that
> represent X, or Y, that are presented in different colours (say, blue
> for X, red for Y). Rather than use a legend, I would like to have the
> title label for the X-axis be in blue, and the title label for the
> Y-axis be in red.
> While it is trivial to change the color of the axis title labels for
> *both* axes at the same time, I haven't figured out how to trick thing
> into generating a blue title label for the X-axis, and a red title label
> for the Y- axis (i.e., different colours on different axes).
> I'm sure this is out there on searchable pages, but, I haven't managed
> to stumble across the appropriate search phrase(s).
> Pointers to the obvious solution welcomed in advance.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help