Plotting color data from cell array using plot()
이전 댓글 표시
I want to quickly plot several hundred traces quickly Using a for loop tends to take quite some time. I found a trick to do it using the following example,
x1 = [1 2 3]
x2 = [2 3 4]
y1 = [1 2 3]
y2 = [3 5 6]
xdata = {x1 x2}
ydata = {y1 y2}
plot(xdata{:}, ydata{:})
BUT
what if i want to color code the data in a specific way? I tried the following, but it doesnt work.
x1 = [1 2 3]
x2 = [2 3 4]
y1 = [1 2 3]
y2 = [3 5 6]
c1 = [1 0 1]
c2 = [0 1 0]
xdata = {x1 x2}
ydata = {y1 y2}
cdata = {c1 c2}
plot(xdata{:}, ydata{:}, 'color', cdata{:})
Is there any way to assign additional information to the information being plotted using plot() such as color, or line style? If not, is there another function? Or must a for loop be used for this
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!