A 2D plot with different colors for each point
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
parham kianian
am 23 Mär. 2020
Beantwortet: darova
am 23 Mär. 2020
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:
0 Kommentare
Akzeptierte Antwort
darova
am 23 Mär. 2020
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');
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Orange finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!