ksdensity with different colors

조회 수: 6 (최근 30일)
Avan Al-Saffar
Avan Al-Saffar 2015년 8월 24일
댓글: Walter Roberson 2015년 8월 24일
I need to plot PDF using '' ksdensity(x) '' for many population at the same figure with different colors for each population.
Can anyone help please?
Regards Avan

답변 (1개)

Walter Roberson
Walter Roberson 2015년 8월 24일
plot the first, specifying a color. Use "hold on". Plot the second, specifying a different color. Plot the third, specifying a third color. Continue for the result of your populations. At the end, "hold off".
  댓글 수: 2
Avan Al-Saffar
Avan Al-Saffar 2015년 8월 24일
편집: Avan Al-Saffar 2015년 8월 24일
Many thanks for your help, but how can I specifie the color in ksdensity function please? Because I tried to do that and I got an error.
What is about '' hold all'' ?
Walter Roberson
Walter Roberson 2015년 8월 24일
Do not rely on ksdensity() to plot the values. Plot them yourself like is shown in the first example at http://www.mathworks.com/help/stats/ksdensity.html

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Exploration and Visualization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by