Info

此问题已关闭。 请重新打开它进行编辑或回答。

coloring the individual data in a plot

1 次查看(过去 30 天)
mahesh bvm
mahesh bvm 2011-9-20
关闭: MATLAB Answer Bot 2021-8-20
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
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')

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by