Scatter plot with different colours,

2 Ansichten (letzte 30 Tage)
sia ben
sia ben am 21 Mai 2022
Beantwortet: Walter Roberson am 22 Mai 2022
I have various audio files in hard disc that are being analyzed individually and the results should be plots. Some audio files come from the same source (musical instruments) and have similar names (first 4 letters are similar). I like plotting similar instruments (with simalar names on the hard disc) with the same colors. How should I create this color array?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 22 Mai 2022
[~, basenames] = fileparts(FileNames);
First4 = cellfun(@(S) S(1:4), basenames, 'uniform', 0);
G = findgroups(First4);
nG = max(G);
colors = YourColormapNameSuchAsJet(nG);
Now for the K'th file, use colors(K,:) as the color entry for scatter purposes.

Weitere Antworten (0)

Kategorien

Mehr zu Data Distribution Plots 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!

Translated by