I'm trying to draw ROC curves using an existing set of values using the following command
plot(X1,Y1,'--rs',X2,Y2,'-*g');
Where X1
,Y1
,X2
and Y2
are matrices that have the same size
However, the lines produced by this command are straight ones.
How can I make them curved lines.
Thanks Aziz
MATLAB by default uses straight line approximation to draw your graph in between control points. If you want, you can interpolate in between the points to produce a more realistic graph. Try using
interp1
with the'spline'
option and see how that goes. As such, figure out the minimum and maximum values of bothX1
andX2
, then define a grid of points in between the minimum and maximum that have finer granularity. Once you do this, throw this intointerp1
and plot your curve. Something like:linspace
generates a grid of points from one end to another, and I specified 100 of these points. I then useinterp1
in the way we talked about where you specify control points (X1,Y1,X2,Y2
), then specify the values I want to interpolate with. I use the output values after interpolation and draw the curve.