【问题标题】:Suppress axis in lattice plot抑制晶格图中的轴
【发布时间】:2016-10-01 02:47:23
【问题描述】:

我正在使用插入符号的featurePlot 函数来创建格子图。 X 和 Y 轴显示在对角线框中(见图)。我想抑制这些轴——包括刻度线和标签。



以为我可以将 scales$draw 设置为 NULL,但这不起作用。这是我尝试过的:
trellisDefaultSettings = trellis.par.get()
trellis.par.set(theme=transparentTheme(trans = .4),
                scales$draw=FALSE,
                warn=FALSE)

featurePlot(x = features[, -1 * ncol(features)],
            y = features$SpeciesName,
            plot = "pairs",
            auto.key = list(columns = 5))

【问题讨论】:

  • 使用pscales=FALSE:详见?panel.pairs
  • @user20650:SO 权力宁愿将答案作为答案提交。它可以让问题被标记为已回答。
  • 嗯,我认为这是值得信赖的。填补了我的知识空白。
  • 谢谢@42-;我确实需要停止如此懒惰

标签: r lattice r-caret trellis


【解决方案1】:

您可以使用参数pscales

例子

library(caret)

featurePlot(x = iris[, -1 * ncol(iris)],
            y = iris$Species,
            plot = "pairs",
            auto.key = list(columns = 3),
            pscales=FALSE)

通过查看featurePlot 的代码,您可以看到它为pairs 绘图调用lattice::splom。该函数的帮助页面描述了使用哪个参数(另见?panel.pairs

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-02
    • 2023-04-09
    • 2014-02-02
    • 1970-01-01
    • 2018-04-24
    • 2014-05-20
    • 1970-01-01
    相关资源
    最近更新 更多