Ggplot2 centre y axis title

前端 未结 1 1070
深忆病人
深忆病人 2021-01-15 19:58

I\'m sure there\'s a simple solution but I have looked around and can\'t find anything.

Essentially I just want to flip the y-axis title horizontally th

相关标签:
1条回答
  • 2021-01-15 20:33

    If I understood you correctly, you were almost there. Under the argument element_text, you can edit the arguments vjust and hjust for vertical and horizontal positioning.

    require(tidyverse)
    
    iris %>% ggplot() + geom_point(aes(x = Sepal.Length, y = Sepal.Width)) +
    theme(axis.title.y = element_text(angle=0, vjust = 0.5))
    

    0 讨论(0)
提交回复
热议问题