I have tried
... + xlab("New label", colour="darkgrey")
and
... + xlab("New label", color="darkgrey")
But it says this argument is unused. I look into ?xlab
, but it doesn't include any color parameter. Is it possible to change it? How?
I have tried
... + xlab("New label", colour="darkgrey")
and
... + xlab("New label", color="darkgrey")
But it says this argument is unused. I look into ?xlab
, but it doesn't include any color parameter. Is it possible to change it? How?
Since ggplot2 0.9.2, the syntax has become:
dat <- data.frame(x = 1:5,y = 1:5)
p + theme(axis.title.x = element_text(colour = "red"),
axis.title.y = element_text(colour = "blue"))
The tidyverse page is a good starting point for learning about all the options.
Note that the old syntax based on opts
has been deprecated. There is detailed transition guide for updating your code.
This changes both the x and y axis:
theme(text=element_text(color="red"))
This also changes the labels of the ticks:
theme(text=element_text(color="red"),axis.text=element_text(color="blue"))