【问题标题】:Remove axis labels in R conditional density plot删除 R 条件密度图中的轴标签
【发布时间】:2011-08-23 12:42:56
【问题描述】:

我无法从条件密度图 (cdplot{graphics}) 中删除 y 轴标签,以便稍后水平旋转它们; axes = FALSE 似乎不起作用。任何想法? 谢谢!

使用 R 文档中的示例数据:

fail <- factor(c(2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1),
               levels = 1:2, labels = c("no", "yes"))
temperature <- c(53, 57, 58, 63, 66, 67, 67, 67, 68, 69, 70, 70, 70, 70, 72, 73, 75, 75, 76, 76, 78, 79, 81)
cdplot(fail ~ temperature, axes = FALSE)

Warning messages:
1: In density.default(x, bw = bw, n = n, ...) :
  non-matched further arguments are disregarded
2: In density.default(x[y %in% levels(y)[seq_len(i)]], bw = dx$bw,  :
  non-matched further arguments are disregarded

【问题讨论】:

标签: r label


【解决方案1】:

由于您没有向我们提供任何数据,我正在使用example(spineplot) 中提供的数据。

您可以通过将适当的参数设置为NA来摆脱轴标签:

spineplot(fail~temperature,yaxlabels=NA)

但如果你想水平定向它们,你通常设置las=1。不幸的是,spineplot 似乎没有传递此信息,因此您需要先致电 par

par(las=1)
spineplot(fail~temperature)

【讨论】:

    猜你喜欢
    • 2013-06-18
    • 1970-01-01
    • 2011-01-27
    • 1970-01-01
    • 2014-05-23
    • 2020-02-08
    • 2016-09-22
    • 1970-01-01
    • 2012-01-21
    相关资源
    最近更新 更多