您的位置:首页 > 其它

octave 之 legend用法

2015-11-28 14:36 417 查看
Function File: legend (str1, str2, …)
Function File: legend (matstr)
Function File: legend (cellstr)
Function File: legend (…, "location", pos)
Function File: legend (…, "orientation", orient)
Function File: legend (hax, …)
Function File: legend (hobjs, …)
Function File: legend (hax, hobjs, …)
Function File: legend ("option")
Function File: [hleg, hleg_obj, hplot, labels] = legend (…)
Display a legend for the current axes using the specified strings as labels.

Legend entries may be specified as individual character string arguments, a character array, or a cell array of character strings.

If the first argument hax is an axes handle, then plot into this axis, rather than the current axes returned by 
gca
. If the handles, hobjs, are not specified then the legend’s strings will be associated with the axes’ descendants.
legend
 works
on line graphs, bar graphs, etc. A plot must exist before legend is called.

The optional parameter pos specifies the location of the legend as follows:

 poslocation of the legend
 northcenter top
 southcenter bottom
 eastright center
 westleft center
 northeastright top (default)
 northwestleft top
 southeastright bottom
 southwestleft bottom
 
 outsidecan be appended to any location string
The optional parameter orient determines if the key elements are placed vertically or horizontally. The allowed values are 
"vertical"
 (default) or 
"horizontal"
.

The following customizations are available using option:

"show"

Show legend on the plot

"hide"

Hide legend on the plot

"toggle"

Toggles between 
"hide"
 and 
"show"


"boxon"

Show a box around legend (default)

"boxoff"

Hide the box around legend

"right"

Place label text to the right of the keys (default)

"left"

Place label text to the left of the keys

"off"

Delete the legend object

The optional output values are

hleg
The graphics handle of the legend object.

hleg_obj
Graphics handles to the text and line objects which make up the legend.

hplot
Graphics handles to the plot objects which were used in making the legend.

labels
A cell array of strings of the labels in the legend.

The legend label text is either provided in the call to 
legend
 or is taken from the DisplayName property of graphics objects. If no labels or DisplayNames are available, then the label text is simply 
"data1"
"data2"
,
…, 
"dataN"
.

Implementation Note: A legend is implemented as an additional axes object of the current figure with the 
"tag"
 set to 
"legend"
. Properties of the legend object may be manipulated directly by using 
set
.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  octave