Filter löschen
Filter löschen

How to make separate graph for each class?

3 Ansichten (letzte 30 Tage)
Adrian Kleffler
Adrian Kleffler am 4 Mai 2023
Hello, i have 6 classes in my project and i need to make one graph for each class... now my graph looks like this and i need graphs with average precision for each class...
...
i want each graph to look like this :
  6 Kommentare
Adrian Kleffler
Adrian Kleffler am 4 Mai 2023
After adding numbers for example 1 to "ap" the figure looks like this (but i don´t know if it´s figure only for first class or no) :
recallv = cell2mat(recall);
precisionv = cell2mat(precision);
[r,index] = sort(recallv);
p = precisionv(index);
figure
plot(r,p)
xlabel("Recall")
ylabel("Precision")
grid on
title(sprintf("Average Precision = %.2f",ap(1)))
Cris LaPierre
Cris LaPierre am 5 Mai 2023
Your data does not appear to have copied correctly. Try saving your variables to a mat file and then attach that to your post using the paperclip icon.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Shree Harsha Kodi
Shree Harsha Kodi am 22 Jun. 2023
To make separate graphs for each class in MATLAB, you can follow these general steps:
1) Identify the classes in your dataset. Depending on your data format, you may need to extract the class labels from your data.
2)Iterate over the classes and create separate graphs for each class. Within each iteration, filter the data points based on the current class and plot them.
Go through the below documentation for a better understanding:
MATLAB Scatter Plot: https://www.mathworks.com/help/matlab/ref/scatter.html
MATLAB Figure Properties: https://in.mathworks.com/help/matlab/creating_plots/setting-graph-properties.html
MATLAB Control Flow (for loop): https://in.mathworks.com/help/matlab/ref/for.html

Kategorien

Mehr zu Specifying Target for Graphics Output finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by