Thanks to @Ethan for introducing me to a new way of depicting the AUC.
I have figured out what was wrong in my code and fixed it. I am adding this as an answer for the sake of completion.
The issue was in the following line,
plot Intgrl=0 FILE u 1:(Intgrl+f(x),f(x)) w table
The function should be supplied with actual values $1
and not just the variablex
. It should be as,
plot Intgrl=0 FILE u 1:(Intgrl+f($1), f($1)) w table
Following is the generated plot.