2

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
  • 21,094
  • 18
  • 110
  • 180

1 Answers1

6

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,542
  • 15
  • 25