How to change the ksdensity transparency

3 visualizaciones (últimos 30 días)
Indu
Indu el 22 de Abr. de 2014
Respondida: José-Luis el 22 de Abr. de 2014
I want to calculate ~10 kernel density estimates and overlay them on top of each other with varying transparency such that all X_f are on the same plot.
figure;
ksdensity(X_f(:,1)); hold on
alpha(1)
ksdensity(X_f(:,2)); hold on
alpha(0.8)
ksdensity(X_f(:,3)); hold on
alpha(0.6)
ksdensity(X_f(:,4)); hold on
alpha(0.4)
Is it possible to change the transparency of kernel density estimates in a similar way/or else how can this be done?

Respuesta aceptada

José-Luis
José-Luis el 22 de Abr. de 2014
ksdensity produces a line object. Line objects have no transparency (alpha) property in Matlab. So no, you can't do what you ask in native Matlab.
That being said, you could always look in the file exchange:

Más respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by