legendmatlab_matlab legend函数用法

这篇博客详细介绍了MATLAB中legend函数的使用方法,包括如何为线图、条形图、饼图等添加图例,以及如何通过指定字符串进行标签定制。还提到了如何控制图例的字体大小、颜色,以及如何操作图例的显示状态,如隐藏、显示、切换等。
摘要由CSDN通过智能技术生成

LEGEND(string1,string2,string3, ...) puts a legend on the current plot

using the specified strings as labels. LEGEND works on line graphs,

bar graphs, pie graphs, ribbon plots, etc.

Y

ou can label any

solid-colored patch or surface object.

The fontsize and fontname for

the legend strings matches the axes fontsize and fontname.

LEGEND(H,string1,string2,string3, ...) puts a legend on the plot

containing the handles in the vector H using the specified strings as

labels for the corresponding handles.

LEGEND(M), where M is a string matrix or cell array of strings, and

LEGEND(H,M) where H is a vector of handles to lines and patches also

works.

LEGEND(AX,...) puts a legend on the axes with handle AX.

LEGEND OFF removes the legend from the current axes and deletes

the legend handle.

LEGEND(AX,'off') removes the legend from the axis AX.

LEGEND TOGGLE toggles legend on or off.

If no legend exists for the

current axes one is created using default strings. The default

string for an object is the value of the DisplayName property

if it is non-empty and otherwise it is a string of the form

'data1','data2', etc.

LEGEND(AX,'toggle') toggles legend for axes AX

LEGEND HIDE makes legend invisible.

LEGEND(AX,'hide') makes legend on axes AX invisible.

LEGEND SHOW makes legend visible. If no legend exists for the

current axes one is created using default strings.

LEGEND(AX,'show') makes legend on axes AX visible.

LEGEND BOXOFF

makes legend background box invisible when legend is

visible.

LEGEND(AX,'boxoff') for axes AX makes legend background box invisible when

legend is visible.

LEGEND BOXON makes legend background box visible when legend is visible.

LEGEND(AX,'boxon') for axes AX making legend background box visible when

legend is visible.

LEGH = LEGEND returns the handle to legend on the current axes or

empty if none exists.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值