雷达图周边标签截止

时间:2015-07-13 08:14:38

标签: r graphics par radar-chart

正如您在此示例中所看到的,我正在尝试绘制多个雷达图。但是,外围轴标签正在截止。我试过用par来指定mar和oma,但没有运气。

其他人可以解决这个问题吗?

require(fmsb)

df <- data.frame(
  a = c(0.5, 0, 0.3),
  stopcuttingmeoff = c(1.2, 0, 0.5),
  c = c(0.25, 0, 0.1),
  d = c(0.25, 0, 0.1),
  dontcutmeoff = c(4, 0, 2))

par(mfrow=n2mfrow(4))
radarchart(df, axistype = 2, centerzero = TRUE, palcex = 0.9)
radarchart(df, axistype = 2, centerzero = TRUE, palcex = 0.9)
radarchart(df, axistype = 2, centerzero = TRUE, palcex = 0.9)
radarchart(df, axistype = 2, centerzero = TRUE, palcex = 0.9)

enter image description here

1 个答案:

答案 0 :(得分:2)

可能的解决方案是使用xpd = TRUE来防止文本在边缘处被切断。 fsmb::radarchart在内部使用text添加注释,但遗憾的是,它不允许您通过text将参数传递给...

因此,您需要全局设置选项:

par(xpd = TRUE, mfrow = c(2, 2), mar = c(2, 1, 2, 1))
radarchart(df, axistype = 2, centerzero = TRUE, palcex = 0.9)
radarchart(df, axistype = 2, centerzero = TRUE, palcex = 0.9)
radarchart(df, axistype = 2, centerzero = TRUE, palcex = 0.9)
radarchart(df, axistype = 2, centerzero = TRUE, palcex = 0.9)

mar调整为任意值,为您的设备提供所需的保证金。