在格子图中抑制轴
Suppress axis in lattice plot
我正在使用插入符号的 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
。
例子
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
)
我正在使用插入符号的 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
。
例子
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
)