有没有办法从现有轴中删除单个图?
有没有一种简单的方法可以从一组轴中删除绘制的线,而不清除轴上的其他所有内容?我正在尝试实现一个带有包含多个数据集的列表框的 GUI。我可以让回调函数绘制所选数据,但我不确定当我取消选择数据集时如何“取消绘制”它。有什么想法吗?
Is there an easy way to remove a plotted line from a set of axes without clearing everything else on the axes? I'm trying to implement a GUI with a listbox containing several data sets. I can make the callback function plot the selected data, but I'm not sure how to 'unplot' it when I deselect a data set. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果保存创建的图形对象的句柄,则可以调用 DELETE 将其从绘图中删除:
或者,如果您没有将句柄保存在变量中,则可以使用 FINDOBJ,找到后将其删除。
如果您实际上不想删除它,而只是打开和关闭线条的可见性,则可以设置
'Visible'
相应图形对象的属性:If you save a handle to the created graphics object, you can call DELETE on it to remove it from the plot:
Alternatively, if you didn't save the handle in a variable, you can search for it using FINDOBJ, then delete it when you find it.
If you don't actually want to delete it, but simply turn the visibility of the line on and off, you can set the
'Visible'
property of the graphics object accordingly: