MATLAB: How to plot roc curve…..

https://in.mathworks.com/matlabcentral/answers/257404-how-to-plot-roc-curve

TPR = [0.86666666667 0.79333333333 0.71333333333];
FPR = [0.06666666667 0.00000000000 0.00000000000];
figure('Name','ROC','NumberTitle','off'),plot(FPR,TPR);
xlabel('FP Fraction');
ylabel('TP Fraction');
grid
Helo every one…above is the code i have been used for plotting roc curve. TPR and FPR are the values obtained at 3 thresholds respectively. The plot which i have attached is obtained from the code. The curve looks strange..could anyone help me in justifying that it is a correct plot or not for the respective parameters?

Best Answer

Given your data, this is the ROC curve. In general the code below is added, but that is optional.
hold on, plot([0 1],[0 1],'--'), hold off
axis([0 1 0 1])
Generally, data points are added in the two corners, but that might not make sense for you.
In terms of Matlab this code is correct. It is not possible for us to tell if made a mistake somewhere else.