如何在Matlab中从轴上讲图例? [英] How to tell legends from axes in Matlab?

查看:83
本文介绍了如何在Matlab中从轴上讲图例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下堆栈溢出问题:

Matlab:如何获取图柄中所有的轴柄?

标识如何从Matlab中的图形获取所有轴的手柄.但是,此列表还将至少在R2008a中包含图例的句柄,而图例也似乎是轴.如何(以编程方式)在轴手柄矢量中从真实绘图轴上识别图例?

identifies how to get handles to all of the axes from a figure in Matlab. However, this list will also contain handles to legends, at least in R2008a, which appear to also be axes. How can I tell (programatically) the legends from the real plot axes in a vector of axes handles?

推荐答案

linkaxes中,所需的代码是:

ax = findobj(gcf,'type','axes','-not','Tag','legend','-not','Tag','Colorbar');

这将返回当前图中所有数据轴的句柄.

This will return the handles of all the data axes in the current figure.

这篇关于如何在Matlab中从轴上讲图例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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