coloring the individual data in a plot

Can anyone please help me in How to plot a group of vectors which represents a bell shaped curve with different colours? I also want to know which color represents which vector.

답변 (1개)

Grzegorz Knor
Grzegorz Knor 2011년 9월 20일

0 개 추천

Use hold all before plot and legend after. For example:
x = -6:.1:6;
hold all
for k=1:5
y = exp(-x.^2/k);
plot(x,y)
end
legend('a','b','c','d','e')

이 질문은 마감되었습니다.

질문:

2011년 9월 20일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by