How to change Xlab,Ylab and values of XY-axis color and font size in R plot

plot, r

Solution

Here's code demonstrating some of the lower level plotting functions that provide the sort of fine-grained control that you're wanting. See the help pages of the several functions for even more options.

plot(rnorm(99), bty="n", axes=FALSE, xlab="", ylab="")
box(col="dodgerblue")
axis(1, col="dodgerblue", col.ticks="green", col.axis="orange", cex.axis=2)
axis(2, col="dodgerblue", col.ticks="green", col.axis="orange", cex.axis=0.8)
mtext("Index", side=1, line=3, col="red", cex=2)
mtext("Value", side=2, line=3, col="purple", cex=0.8)

(The resulting plot is ugly enough that I'll let you run the code yourself, rather than reproduce it here!)

Problem

I'd like to change the color and font size of: - Xlab, - Ylab, - values of X and Y-axis - Panel border (color) in R plot Is there a way to do it?

Original source