I had drawn a ROC curve using the following codes:
roc_plot <- function(data, x, y){
fit <- roc(response = data[[x]], predictor = data[[y]])
plot(fit,
print.auc = T,
print.auc.x=0.2, print.auc.y= 0,
print.thres = T,
print.thres.cex = 1,
legacy.axes = T,
grid = T,
auc.polygon = T,
lwd= 2, # ROC 線粗
identity.lty =2,
smooth= T,
main="ROC Curve",col="#1c61b6")
}
roc_M2BP_plot <- roc_plot(sheet_4, "HCC", "M2BP")
At first, it looks normal

However, one day, it became like this

Note that the threshold, AUROC were all correct.
Actually, the plot is also correct if I set legacy.axes = F

What is the problem? I thought I didn't change the Excel data.