so I read that we can obtain x and y using h.xData and h.yData
So ,this is what I did
plot(pts(1,:),pts(2,:));
set(gca,'YDir','reverse');
ax=gca;
h = findobj(gca,'Type','line');
x = h.XData;
y = h.YData;
Final_set_pts=[x;y];
however when I plot final_set_pts,the result is same as before,any suggestions on what i am doing wrong here will be welcome.