在 ggplot2 2.0 中使用 axis.ticks.margin
时,我收到一条警告消息:
axis.ticks.margin
is deprecated. Please setmargin
property ofaxis.text
instead.
我以为我可以尝试 axis.text.margin
但我收到另一个警告,说它是一个无效函数。发行说明说:
The theme setting
axis.ticks.margin
has been deprecated: now use the margin property of axis.ticks.
那么现在边距设置在哪里?
最佳答案
请参阅 theme
上的 ggplot 2.0 文档:
axis.text
tick labels along axes (element_text; inherits from text)
这应该位于 element_text
元素中。它的doc指向函数margin
。沿着这些思路的东西应该有效:
+ 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")))
关于r - 替代 ggplot2 2.0 中已弃用的 axis.ticks.margin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34528664/