how to set color in plot

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 件のコメント

Jan
Jan 2013 年 4 月 2 日
I've tried to close this message without success. Due to the absolute absence of any information about this image, it is impossible to guess, what exactly you try to "make".
This is actually such lean, that I think of a late April joke.
Jan
Jan 2013 年 4 月 2 日
編集済み: Jan 2013 年 4 月 2 日
Thanks for editing your question. Does this mean, that you want to create a colormap? I don't understand, what the "example data" mean. Are you looking for a method to set the color of drawn points, or a function to define the color depending on the values?
Please do not let us guess the details.
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 日

1 投票

PointSize = 10;
scatter3(structure(:), noise(:), diversity(:), PointSize, visualcomplexity(:))

3 件のコメント

Fathor
Fathor 2013 年 4 月 3 日
thank you, it work. but I have not been able to adjust the color of variable visualcomplexity. for example : 0-3=blue; 3.1-6=purple; 6.1-10=red;
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 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by