how to set color in plot

1 Ansicht (letzte 30 Tage)
Fathor
Fathor am 2 Apr. 2013
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 Kommentare
Fathor
Fathor am 2 Apr. 2013
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 am 2 Apr. 2013
That's what my scatter3() solution does.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 2 Apr. 2013
PointSize = 10;
scatter3(structure(:), noise(:), diversity(:), PointSize, visualcomplexity(:))
  3 Kommentare
Walter Roberson
Walter Roberson am 3 Apr. 2013
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 am 3 Apr. 2013
thank you very much for your answer, it work...it's really what i want

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by