Contour levels corresponding to variable levels in ggplot2
问题 I am trying to draw contour plot with ggplot2 and it is proving to be a little harder than I imagined. Using the iris dataset I am able to produce this plot: ggplot(iris, aes(x=Petal.Width, y=Petal.Length, fill=Sepal.Width)) + stat_density2d(geom="polygon", aes(fill=..level..)) My issue is that I can't seem to figure out how to display- rather than the density values -the raw Sepal.Width values. Here is what I've tried: ggplot(iris, aes(x=Petal.Width, y=Petal.Length, z=Sepal.Width)) + geom