Remove rigth bar from Levelplot
Asked Answered
E

1

6

I'm trying to remove the right bar from a levelplot, the one that says the scale in colors. I don't know if there's some way to crop the graph or create a custom function that doesn't print that.

Here is a simple levelplot:

  data(mtcars)
  cars.matrix <- as.matrix(mtcars[c(2:8)])
  cars.corr <- cor(cars.matrix)
  levelplot(cars.corr)
Erubescence answered 12/8, 2015 at 0:6 Comment(0)
W
5

You simply add colorkey=FALSE to the levelplot function.

require(lattice)
data(mtcars)
cars.matrix <- as.matrix(mtcars[c(2:8)])
cars.corr <- cor(cars.matrix)
levelplot(cars.corr, colorkey=FALSE)
Windowsill answered 15/8, 2017 at 12:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.