Azzera filtri
Azzera filtri

Scatter plot with different colours,

1 visualizzazione (ultimi 30 giorni)
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?

Risposta accettata

Walter Roberson
Walter Roberson il 22 Mag 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.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by