开发者

MATLAB Plotting multiple lines with different ledgends/colours on same graph [duplicate]

开发者 https://www.devze.com 2023-03-26 09:50 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Automatically plot different colored lines in MATLAB
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Automatically plot different colored lines in MATLAB

I have the following data

X <25x139 double>
t <25x1 double>
names <139x1 cell>

So essentially t is time, and X is a matrix of 139 different samples at each time interval, 开发者_如何学运维where names is an array of each of those sample names.

I want to plot (on the same axis) a range of my samples against time, where each line has

a) A different color

b) A legend name


does this work?

plot(t,X);legend(names);
0

精彩评论

暂无评论...
验证码 换一张
取 消