Effacer les filtres
Effacer les filtres

Scatter plot with different colours,

1 vue (au cours des 30 derniers jours)
sia ben
sia ben le 21 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?

Réponse acceptée

Walter Roberson
Walter Roberson le 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.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by