首页 文章

在格子图中抑制轴

提问于
浏览
5

我正在使用插入符号 featurePlot 函数来创建一个格子图 . X和Y轴显示在对角线框中(见图) . 我想要抑制这些轴 - 包括标记和标签 .


enter image description here


以为我可以将scale $ 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))

1 回答

  • 4

    您可以使用参数 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

相关问题