I keep getting error using plot not enough input arguments.

3 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
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
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 Sequence and Numeric Feature Data Workflows 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!