例如:
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..))
侧面有两个图例,我可以删除其中一个吗?
见这里: http ://www.cookbook-r.com/Graphs/Legends_(ggplot2)/
您需要的线路是
v1 = v + stat_contour(aes(colour=..level..,size=..level..)) +
scale_colour_continuous(guide=FALSE)
用于scale_size_continuous
关闭尺寸图例。