-1

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

  • By selecting a particular area you mean that you know this area limits before, or is it selected interactively (like using zoom etc) ? – bla Nov 21 '12 at 06:40
  • basically what I have is a plot with x,y directions in meters and a colorbar showing different densities all over the region. I want to find the density for a particular section. – Rohan Chakrabarty Nov 21 '12 at 06:54

1 Answers1

0

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.

bdecaf
  • 4,652
  • 23
  • 44