问题
I am basically plotting several million data points with help of scatterplot. here I am doing
scatter(x(1:end-1), y(1:end-1),5, z)
Now is possible to select a particular area in the plot...and find out the values. I dont know if you will understand my question or not.
As an alternative is it possible to reduce the datapoints from the beginning itself, so that those dont come in my calculation. I am using following to read the data
fid = fopen('cr.txt');
A = textscan(fid, '%f %f %f %f %f %*f %*f %*f %*f %*f %*s %*s %*s') ;
%read the file
a = A{1};
e = A{2};
c = A{3};
x = A{4};
y = A{5};
here x,y are the distances and if I apply xlim and ylim, I want to limit the correspondin a,e,c from the file also
回答1:
Depends on how you want to select an area.
most generally you could go if you mark the area with ginput
and locate the points using inpolygon
(look at doc inpolygon
- has a very nice example)
If you just want to select an rectangle it's probably best if you write your own function - but that is trivial.
来源:https://stackoverflow.com/questions/13487407/is-it-possible-to-select-a-particular-region-in-a-scatterplot