![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/278927/image.png)
A 2D plot with different colors for each point
조회 수: 2 (최근 30일)
이전 댓글 표시
Suppose time is a column vector of length Lt, freq and amp are matrces of size Lt * n. I want to plot a each column of freq against time such that color of each point should be determined using amp matrix. In fact I want to construct something like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/278881/image.jpeg)
댓글 수: 0
채택된 답변
darova
2020년 3월 23일
Using patch()
n = 30;
x = linspace(0,10,n)';
y = sin(x);
c = jet(n);
fv.vertices = [x y];
fv.faces = [1:n-1;2:n]'; % connection list
cla
h = patch(fv,'facevertexcdata',c,...
'edgecolor','interp',...
'linewidth',2,...
'marker','o');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/278927/image.png)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Orange에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!