I am working on making a simple interactive plotter in Matlab. What I am doing is simple: I use the command:
[x,y] = ginput(1)
来标记位置(x,y) 。然后,我用这个点作为种子点来绘制曲线,我还会在绘图曲线的顶部添加一些箭头(显示方向)。
Now my question is: After I am done with the figure, I would like to be able to select (and for instance delete) a single curve and ITS corresponding ARROWS with just one single click.
问题是,这些箭头和曲线不是同一对象的一部分,因此Matlab只删除曲线或箭头,这取决于从哪个角度开始选择的曲线或箭头。
Narrowing it down, I know that the curve and arrows do have separate object handlers. Rephrasing my question: Is there anyway that I could either group these two separate handlers or, for instance, make arrows children of the original curve?