is it possible to select a particular region in a scatterplot

时间秒杀一切 提交于 2019-11-28 14:04:04

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!