Matlab Plot Data Extraction
===

I have a plot which contain two different data sets. After Plotting data, user would remove some data points and then he should get the remaining data. How to do that? I had done in the following way, but i am not sure whether it is correct.

    h = findobj(gcf,'Type','Line');
    x = get(h,'XData');
    y = get(h,'YData');
 
I am getting the following

    x = 

    [1x3975 double]
    [1x50   double]
    [1x50   double]
    [1x50   double]
    [1x3975 double]
    [1x50   double]
    [1x50   double]
    [1x50   double]
    [1x3975 double]
    [1x50   double]
    [1x50   double]


    y = 

    [1x3975 double]
    [1x50   double]
    [1x50   double]
    [1x50   double]
    [1x3975 double]
    [1x50   double]
    [1x50   double]
    [1x50   double]
    [1x3975 double]
    [1x50   double]
    [1x50   double]

I dont know how to access these points. Actually i am trying to plot some data and user can remove some data points or else when user select some points color of those points should be different from other points.