是否可以在散点图中选择特定区域 [英] is it possible to select a particular region in a scatterplot

查看:167
本文介绍了是否可以在散点图中选择特定区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上是借助散点图绘制了数百万个数据点.我在这里

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)

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};

这里x,y是距离,如果我应用xlim和ylim,我也想从文件中限制对应的a,e,c

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

推荐答案

取决于您要如何选择区域.

Depends on how you want to select an area.

通常,如果您用ginput标记区域并使用inpolygon定位点(请参阅doc inpolygon-有一个非常好的示例)

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.

这篇关于是否可以在散点图中选择特定区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆