I keep getting error using plot not enough input arguments.

2 views (last 30 days)
I keep getting error when I try to plot the following code and I don't really know what to do.
figure
plot(recall,precision)
xlabel("Recall")
ylabel("Precision")
grid on
title(sprintf("Average Precision = %.2f",ap))
Error using plot
Not enough input arguments.
  3 Comments
Adrian Kleffler
Adrian Kleffler on 4 May 2023
[ap,recall,precision] = evaluateDetectionPrecision(detectionResults,testData);
like this
Adrian Kleffler
Adrian Kleffler on 4 May 2023
i improved the code to something like this :
recallv = cell2mat(recall);
precisionv = cell2mat(precision);
figure
plot(recallv,precisionv)
xlabel("Recall")
ylabel("Precision")
grid on
title(sprintf("Average Precision = %.2f",ap))
the graph is shown but it looks bad, something else is wrong also.

Sign in to comment.

Answers (1)

Dyuman Joshi
Dyuman Joshi on 4 May 2023
You need to sort your x data.
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))
  6 Comments
Adrian Kleffler
Adrian Kleffler on 4 May 2023
recall :
0
[0;0.166666666666667;0.333333333333333;0.500000000000000;0.666666666666667;0.833333333333333]
20x1 double
[0;0.125000000000000;0.250000000000000;0.375000000000000;0.500000000000000;0.625000000000000;0.750000000000000;0.875000000000000;1]
12x1 double
[0;0.111111111111111;0.222222222222222;0.333333333333333;0.444444444444444;0.555555555555556;0.666666666666667;0.777777777777778;0.888888888888889;1]
precision :
1
[1;1;1;1;1;1]
20x1 double
[1;1;1;1;1;1;1;1;1]
12x1 double
[1;1;1;1;1;1;1;1;1;1]
i want to say that i have 6 classes in my project, so in that graph (on the top of the graph, ap = 0,83, ap = 0,29...) i posted, there are average precisions for 6 classes in my opinion ... i don´t know if its possible to combine them to only one average precision or what to do with them... on matlab page there is one example where the graph looks like this (but they had only one class to detect) :
I hope you understand me, and i am so thankful for your answers.
Adrian Kleffler
Adrian Kleffler on 4 May 2023
maybe it will be easier to make one graph for each class, but i don´t know how to do it ...

Sign in to comment.

Categories

Find more on Networks in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!