Octave-如何查找轴中的活动对象
Matlab 有一个名为 gco(获取当前对象)的属性,可用于在按下鼠标后识别一行。
例如:
等待按下按钮
句柄=gco
.. 用句柄做一些事情...
Octave 有 gcf (获取当前图形)和 gca (获取当前轴),但它是否具有与 Matlab 的 gco 类似的机制。目标是操纵轴上的线,并通过鼠标单击来识别它们。
BR,安蒂
Matlab has a property called gco (get current object) that can be used to identify a line after mouse press.
For example:
waitforbuttonpress
handle=gco
.. do something with handle...
Octave has gcf (get current figure) and gca (get current axes), but does it have a similar mechanism than Matlab's gco. Target is to manipulate lines in the axis and they are identified with mouse clicks.
BR, Antti
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定这是否是您所要求的,但我知道一种可能的解决方法,至少可以扩展以满足您的需求。如果这样做:
那么在绘图中的某个位置单击 n 次后,您将获得在列向量 x、y 和 k 中单击的位置的 X 和 Y 坐标的输出,这将告诉您在每个位置单击了哪个鼠标按钮那些地点。
I'm not sure if this is what you are asking, but I know one possible workaround which at the very least could be expanded to fulfill what you are looking for. If you do:
then after you click n times somewhere in the plot, you will get an output of the X and Y coordinates of where you clicked in the column vectors x, y and k will give you which mouse button was clicked at each of those locations.