3 dim plot, how to specify color for each point

Hello,
Suppose I want to plot 3-d sin(x+y), x = [0, pi], y = [0, pi]. I have a 3*n matrix to denote the RGB for each point. How to efficiently generate the plot?
Thanks,
Weizhou

 Akzeptierte Antwort

Thorsten
Thorsten am 12 Okt. 2015
Bearbeitet: Thorsten am 12 Okt. 2015

0 Stimmen

x = linspace(0,pi);
y = x;
z = sin(x+y);
col = jet(numel(x)); % sample color from jet colormap
scatter3(x,y,z, [], col)

Weitere Antworten (0)

Kategorien

Mehr zu Color and Styling finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 12 Okt. 2015

Bearbeitet:

am 12 Okt. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by