以下 stackoverflow 问题:
Matlab: How to obtain all the axes handles in a figure handle?
确定如何从 Matlab 中的图形获取所有轴的句柄。但是,此列表还将包含图例句柄,至少在 R2008a 中是这样,它们似乎也是轴。我如何(以编程方式)从轴 handle 向量中的真实绘图轴中辨别图例?
最佳答案
来自linkaxes
,你想要的代码是:
ax = findobj(gcf,'type','axes','-not','Tag','legend','-not','Tag','Colorbar');
这将返回当前图中所有数据轴的句柄。
关于matlab - 如何从 Matlab 中的轴中辨别图例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9071988/