Hello,
Is it possible to extract the lines, or polygons, or the points used to construct them, from a geom_density2d object?
Example:
library(ggplot2)
library(MASS)
data(geyser, "MASS")
m <- ggplot(geyser, aes(x = duration, y = waiting)) +
geom_density2d()
In the example case, I would extract from the m object the points used to draw the isocontour lines, transform these points to another scale, then replot them using geom_polygon in the new scale. Drawing contours directly from data transformed in the new scale wouldn't be relevant.
Thanks!
Serge-Éti. Parent
Université Laval
Québec (Canada)