How to change axis-label color in ggplot2?

后端 未结 1 1799
时光取名叫无心
时光取名叫无心 2021-01-17 15:45

I have tried

... + xlab(\"New label\", colour=\"darkgrey\")

and

... + xlab(\"New label\", color=\"darkgrey\")
相关标签:
1条回答
  • 2021-01-17 15:56

    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.

    0 讨论(0)
提交回复
热议问题