$LastChangedDate: 27-Juil-2011 $

# CL_g_legend

Defines a legend adequately positioned with optional title

## Calling Sequence

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

## Description

- Defines a legend positioned adequately by changing some properties of the axes it is derived from (right margin).

  A title may be optionally defined.

  The legend is optionally created in a new axes entity in order to avoid having the title move when zooming in/out.

## Parameters

a:

  Handle of the axes entity. Default = current axes (gca()).

str:

  Strings used for the legend (1xN or Nx1: as many as there are 'Polyline' entities in 'a').

pos:

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

header:

  (optional) Title of the legend.

new_axes:

  (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

- CNES - DCT/SB (AL)

## Examples

    f=scf();
    a=gca();
    x = 0:0.1:5;
    y = x;
    plot(x, y);
    plot(x, 2*y, '-r');
    CL_g_legend(a, str=["plot 1", "plot 2"]);