I'm trying to rotate ylab 0 however when I do it, it for some reason does not stay in the middle but moves it all the way to the top left. What I want is to have the y title in the middle next to the .5 level.
df = data.frame(id=c("a","b","c"), level=c(1,2,3))
ggplot(df, aes(x = id, fill = level )) +
geom_bar() +
ylab("level") +
theme(
axis.title.y=element_text(angle = 0),
axis.ticks.y=element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_blank(),
axis.title.x=element_blank(),
axis.text.x=element_blank(),
axis.ticks.x=element_blank()
) + theme(legend.position="right", legend.title=element_blank(), legend.key = element_blank() )
