3

For example:

require(ggplot2)
require(reshape2)
volcano3d <- melt(volcano) 
names(volcano3d) <- c("x", "y", "z") 
v <- ggplot(volcano3d, aes(x, y, z = z)) 
v1 = v +  stat_contour(aes(colour=..level..,size=..level..)) 

enter image description here

There are two legends on the side, can I remove one of them?

qed
  • 22,298
  • 21
  • 125
  • 196

1 Answers1

7

See here: http://www.cookbook-r.com/Graphs/Legends_(ggplot2)/

The line you'll need is

v1 = v +  stat_contour(aes(colour=..level..,size=..level..)) + 
scale_colour_continuous(guide=FALSE)

Use scale_size_continuous to turn off the size legend.

colcarroll
  • 3,632
  • 17
  • 25