Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress axis in lattice plot

I am using caret's featurePlot function to create a lattice plot. The X and Y axes show up in the diagonal boxes (see picture). I want to suppress these axes-- both the tickmarks and labels.


enter image description here


Thought I could set scales$draw to NULL, but that did not work. Here is what I tried:
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))
like image 590
ahoffer Avatar asked Jun 01 '16 16:06

ahoffer


1 Answers

You can use the argument pscales.

Example

library(caret)

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

From looking at the code for featurePlot, you can see it calls lattice::splom for the pairs plot. The help page for this function describes which argument to use (see also ?panel.pairs)

like image 133
user20650 Avatar answered Nov 04 '22 23:11

user20650