Changing font size and direction of axes text in ggplot2

前端 未结 7 1249
萌比男神i
萌比男神i 2020-11-28 17:37

I am plotting a graph with a categorical variable on the x axis and a numerical variable on the y axis.

For the x axis, given that there are many data points, the de

7条回答
  •  庸人自扰
    2020-11-28 18:27

    Use theme():

    d <- data.frame(x=gl(10, 1, 10, labels=paste("long text label ", letters[1:10])), y=rnorm(10))
    ggplot(d, aes(x=x, y=y)) + geom_point() +
    theme(text = element_text(size=20))
    

提交回复
热议问题