MATLAB: How to draw a line on top of an imagesc

imagsclineMATLABplot

When I issue a plot command, the previously drawn image disappears and is replaced by the line.

Best Answer

Use hold on
imagesc(yourImage);
hold on;
line([x1,x2], [y1,y2], 'Color', 'r');