Collect and plot data and legend depending on folder name
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello together,
I have multiple data that will be analyzed with TP-Rate and FD-Rate and plot this to ROC curve.
I want to compare data with this principle (german):
(I want to compare datasets from fifferent motors with two microphones and two distances, and three measure scenario)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/320830/image.png)
My folder Strukture is here:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/320833/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/320836/image.png)
At the moment I get this graph:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/320839/image.png)
I want to have graphs like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/320842/image.png)
or this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/320845/image.png)
So, I want to collect a foldername from Motor_Set_x to 2-3 subfolder and print it in legend to compare data from first and second folder.
Here is my code:
for loop with k calculations
end
labels = (1:k);
figure('Name',' receiver operating characteristic','NumberTitle','on');
hold on
p11 = plot(M(:,2),M(:,1),'ro','Color','g'); %Here I can randomize a colors
buffer = [.1 .3 .5];
buffer = repmat(buffer,1,ceil(numel(M(:,2))/numel(buffer)));
buffer(numel(M(:,2))+1:end) = [];
[~, ySortIdx] = sort(M(:,2));
buffer(ySortIdx) = buffer;
labelpoints(M(:,2),M(:,1), name_save, 'E', buffer)
hold on
help_x = 0:0.1:1;
help_y = 0:0.1:1;
plot(help_x,help_y,'--');
xlabel('False discovery rate')
ylabel('True positive rate')
xlim([0 1]);
ylim([0 1]);
lgd = legend([p11],'Result','Location','east');
title(lgd,'n = Measure number')
tube_size_help = sprintf('%.0f',tube_size);
nameX=strcat(name ,'_tube_size_',tube_size_help);
saveas(gcf, 'result_F0_detection_1M.png')
save 'result.mat' M
Do you have some idea? Thank you!
Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D 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!