shlegend
plots legend
Contents
Syntax
Hlegend = shlegend (legend, pos, space, txt, i_legend, file)
Description
plots legend
Input:
- legend: (n,2)-cell matrix with with marker (5-vector of cells), label (character or cell string)
- pos: optional 2-vector with position of lower-left corner of legend within box (default: 0.7, 0.2)
- space: optinal 2-vector with space between marker and item (horizontal) space between marker and marker (vertical); default: 0.9, 0.45
- txt: optional character string with title above legend figure
- i_legend: optional integer with highlighter (from 1 till n)
- file: optional png-file name; if given, the legend figure is saved to it and cropped (white border removed, white made transparent). The '.png' extension is optional.
Output:
- Hlegend: handle of figure (returned whether or not file is written, so it can still be edited)
Remarks
- create legend with select_legend; press any key when done with select_legend
Example of use
- Hleg = shlegend(select_legend);
- legend = select_legend; Hleg = shlegend(legend, [], [], 'my_legend'); % white border removed, white made transparent
- Hleg = shlegend(legend); saveas(Hleg,'legend.png'); cropWhite('legend');