[R] different coloured axis title labels for different axes

Evan Cooch evan.cooch at gmail.com
Mon Jan 11 20:05:34 CET 2016



On 1/11/2016 1:54 PM, William Dunlap wrote:
> The following shows how to get different colors for most features of a
> scatterplot:
>
> plot(1:11,log(1:11),ann=FALSE,axes=FALSE,col="pink",pch=16)
> box(col="gray")
> 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)",
> col.sub="yellow")
>
> See help(par) for details.  The 'cex' and 'font' parameters have same
> subtypes as 'col'.
>
>
>


Thanks -- very helpful.



More information about the R-help mailing list