<< CL_g_delete Utilities CL_g_select >>

CelestLab >> Utilities > CL_g_legend

CL_g_legend

Defines a legend adequately positioned with optional title

Calling Sequence

hl = CL_g_legend(h,str [,pos,header,new_axes])

Description

Parameters

h:

Graphic handle of an Axes entity or (not empty) vector of handles of polyline entities (same as legend).

str:

(string) Legend labels (1xN or Nx1: as many as there are 'Polyline' entities in 'a').

pos:

(optional) Position (normalized coordinates) of the legend: [x,y] where x: distance from the left, y: distance from the top. Default is [0.75, 0.2].

header:

(optional) Title of the legend.

new_axes:

(boolean, optional) %t if the legend must be created in a new axes entity. Default is %t if 'header' is defined, else it is %f.

hl:

Handle of the legend entity created.

Authors

Examples

// Example 1
f = scf();
plot([1,2], [1,2], "r");
plot([1,2], [1,3], "b");
CL_g_legend(gca(), ["red", "blue"]);

// Example 2
f = scf();
plot([1,2], [1,2], "r"); h1 = gce();
plot([1,2], [1,3], "b"); h2 = gce();
CL_g_legend([h1, h2], ["red", "blue"]);

Report an issue
<< CL_g_delete Utilities CL_g_select >>