Hi,
I have a following problem. I want to change the size of labels in my ggplot. See picture bellow:
I read the documentation (theme function - RDocumentation) and I tried
theme(axis.text=element_text(size=20),
axis.title=element_text(size=20),
axis.ticks=element_text(size=20),
axis.line=element_text(size=20))
but it did not work. What do I do wrong please? Thanks a lot.
Reprex here:
require(forcats)
require(ggplot2)
require(dplyr)
df <- data.frame(x = c("A", "B", "C", "D", "E"),
estimate = c(-0.03, 0.06 , 0.15 , -0.003, 0.01 ),
CI_up = c(-0.03 + 0.06*1.96, 0.06 + 0.02*1.96, 0.15 + 0.04*1.96, -0.003 + 0.06*1.96 , 0.01 + 0.01*1.96) ,
CI_down = c(-0.03 - 0.06*1.96, 0.06 - 0.02*1.96, 0.15 - 0.04*1.96, -0.003 - 0.06*1.96 , 0.01 - 0.01*1.96) )
df %>%
mutate(x = fct_reorder(x, desc(estimate))) %>%
ggplot(aes(x = x, y = estimate)) +
geom_point(size = 4) +
geom_errorbar(aes(ymax = CI_up, ymin = CI_down)) +
labs(x = "My X axis", y = "My Y axis") +
theme(axis.text=element_text(size=555),
axis.title=element_text(size=14)) +
geom_hline(yintercept = 0) +
theme_bw()