
Last chance! 50% off unlimited learning
Sale ends in
stat_ellipse(mapping = NULL, data = NULL, geom = "path",
position = "identity", type = "t", level = 0.95, segments = 51,
na.rm = FALSE, ...)
type="euclid"
, the radius of the circle to be drawn."t"
assumes a multivariate t-distribution, and
"norm"
assumes a multivariate normal distribution.
"euclid"
draws a circle with the radius equal to level
,
representing theFALSE
(the default), removes missing values with
a warning. If TRUE
silently removes missing values.aes
or aes_string
. Only needs to be set
at the layer level if you are overriding the plot defaults.ggplot(faithful, aes(waiting, eruptions))+
geom_point()+
stat_ellipse()
ggplot(faithful, aes(waiting, eruptions, color = eruptions > 3))+
geom_point()+
stat_ellipse()
ggplot(faithful, aes(waiting, eruptions, color = eruptions > 3))+
geom_point()+
stat_ellipse(type = "norm", linetype = 2)+
stat_ellipse(type = "t")
ggplot(faithful, aes(waiting, eruptions, color = eruptions > 3))+
geom_point()+
stat_ellipse(type = "norm", linetype = 2)+
stat_ellipse(type = "euclid", level = 3)+
coord_fixed()
ggplot(faithful, aes(waiting, eruptions, color = eruptions > 3))+
stat_ellipse(geom = "polygon")
Run the code above in your browser using DataLab