Closed NightMachinery closed 4 years ago
In Geom.density2d
, the contour levels are merely the heights of the density function. A density function can definitely have a height >1, see the mixture model example (third plot for Geom.density).
There is also Geom.ellipse
, which gives the confidence ellipses for the MvNormal model.
@Mattriks Hmm ... Can you point me on any docs on what the density function is? I thought it groups input by bins, and assigns each bin its fraction of the total.
Geom.density
and Geom.density2d
use the kde
function in KernelDensity.jl. Here's another example:
N = Normal(0, 0.1) # try changing the sd
plot(x=rand(N, 100), Geom.density, color=["Estimated"],
layer(x->pdf(N, x), -1, 1, color=["Parametric"])
)
Would adding to the doc strings for Geom.density
and Geom.density2d
, that those geoms use the kde
function for density calculation, close this issue?
@Mattriks yes, thank you.
I am trying to plot a 2d density graph, and I use this function to compute levels for Geom.density:
I get
stepz: 0.1, minz: 0.0, maxz: 1.9412042100886135
after running the plot; Shouldn'tz
be between 0 and 1? It's supposed to be a density plot ...