Scatter plot with different colours,

2 次查看(过去 30 天)
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?

采纳的回答

Walter Roberson
Walter Roberson 2022-5-22
[~, 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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Distribution Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by