Ignacio
Ignacio

Reputation: 7938

ggplot2 move horizontal y label to the top?

How can I move the y label up to the top? (In this case, right bellow 35)

library(ggplot2)
ggplot(mtcars, aes(wt, mpg)) + 
  geom_point() + 
  ylab("First line \nSecond Line") + 
  theme(axis.title.y = element_text(angle = 0))

Thanks,

Ignacio

Upvotes: 0

Views: 1390

Answers (1)

Heroka
Heroka

Reputation: 13139

axis.title.y=element_text(angle=0,vjust=1)

Upvotes: 2

Related Questions