how to set color in plot

2 次查看(过去 30 天)
actually,i try to create a plot that containts three variables (structure, noise, diversity). i use the data that generated from excel. the most important fact is how to set color of the data as in the example image
example data from excel : structure = 0.7; noise = 6; diversity = 14; visual complexity value = 0.4; then, color of data = purpel
  4 个评论
Fathor
Fathor 2013-4-2
thanks for your concern. i mean, sample data from excel. so, i try to create plot with four variable (structure,noise,diversity,visualcomplexity). where visualcomplexity defined by color
Walter Roberson
Walter Roberson 2013-4-2
That's what my scatter3() solution does.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2013-4-2
PointSize = 10;
scatter3(structure(:), noise(:), diversity(:), PointSize, visualcomplexity(:))
  3 个评论
Walter Roberson
Walter Roberson 2013-4-3
ccolors = [0 0 1;
1 0 1;
1 0 0];
binedges = [0 3 6 inf];
[counts, binindx] = histc(visualcomplexity, binedges);
scatter3(structure(:), noise(:), diversity(:), PointSize, ccolors(binidx(:), :) );
Fathor
Fathor 2013-4-3
thank you very much for your answer, it work...it's really what i want

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by