I have a really simple question, which I am struggling to find the answer to. I hoped someone here might be able to help me.
An example dataframe is presented below:
a <- c(1:10)
b <- c(10:1)
df <- data.frame(a,b)
library(ggplot2)
g = ggplot(data=df) + geom_point(aes(x=a, y=b)) +
xlab("x axis")
g
I just want to learn how I change the text size of the axes titles and the axes labels.
Best Answer
You can change axis text and label size with arguments
axis.text=
andaxis.title=
in functiontheme()
. If you need, for example, change only x axis title size, then useaxis.title.x=
.There is good examples about setting of different
theme()
parameters in ggplot2 page.