Substitution for deprecated axis.ticks.margin in ggplot2 2.0

前端 未结 1 447
抹茶落季
抹茶落季 2021-01-04 02:46

When using axis.ticks.margin in ggplot2 2.0, I got a Warning message:

axis.ticks.margin is deprecated. Please set marg

相关标签:
1条回答
  • 2021-01-04 02:50

    See the ggplot 2.0 doc on theme:

    axis.text

    tick labels along axes (element_text; inherits from text)

    This should be in an element_text element. Its doc points to function margin. Something along those lines should work:

    + theme(axis.text.x = element_text(margin=margin(5,5,10,5,"pt")),
            axis.text.y = element_text(margin=margin(5,5,10,5,"pt")))
    
    0 讨论(0)
提交回复
热议问题