[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.8 Legend
These functions draw legend to the graph (useful for 1D plotting). Legend entry is a pair of strings: one for style of the line, another one with description text (with included TeX parsing). The arrays of strings may be used directly or by accumulating first to the internal arrays (by function AddLegend()) and further plotting it. The position of the legend can be selected automatic or manually. Parameters font and size specify the font style and size (see section Font settings). Parameter llen set the relative width of the line sample and the text indent. If line style string for entry is empty then the corresponding text is printed without indent. If string font contains symbol ‘A’ then legend coordinates set position in the picture (not in the current subplot). See section Legend sample, for sample code and picture.
- Method on
mglGraph
(C++, Python):void
Legend (int
where=0x3
,const char *
font="rL"
,float
size=-0.8
,float
llen=0.1
) - C function:
void
mgl_legend (HMGL
gr,int
where,const char *
font,float
size,float
llen) Draws legend of accumulated legend entries by font font with size. Parameter where sets the position of the legend: ‘0’ is bottom left corner, ‘1’ is bottom right corner, ‘2’ is top left corner, ‘3’ is top right corner (is default).
- Method on
mglGraph
(C++):void
Legend (int
n,wchar_t **
text,char **
style,int
where=0x3
,const char *
font="rL"
,float
size=-0.8
,float
llen=0.1
) Draws legend with n-th elements of string array text by font font with size. Entry strings text describe curves with line style style (including marks). Parameter where sets the position of the legend: ‘0’ is bottom left corner, ‘1’ is bottom right corner, ‘2’ is top left corner, ‘3’ is top right corner (is default).
- Method on
mglGraph
(C++, Python):void
Legend (float
x,float
y,const char *
font="rL"
,float
size=-0.8
,float
llen=0.1
) - C function:
void
mgl_legend_xy (HMGL
gr,float
x,float
y,const char *
font,float
size,float
llen) Draws legend of accumulated legend entries by font font with size. Position of legend is determined by parameter x, y which supposed to be normalized to interval [0,1].
- Method on
mglGraph
(C++):void
Legend (int
n,wchar_t **
text,char **
style,float
x,float
y,const char *
font="rL"
,float
size=-0.8
,float
llen=0.1
) Draws legend with n-th elements of string array text by font font with size. Entry strings text describe curves with line style style (including marks). Position of legend is determined by parameter x, y which supposed to be normalized to interval [0,1].
- Method on
mglGraph
(C++, Python):void
AddLegend (const char *
text,const char *
style) - Method on
mglGraph
(C++):void
AddLegend (const wchar_t *
text,const char *
style) - C function:
void
mgl_add_legend (HMGL
gr,const char *
text,const char *
style) - C function:
void
mgl_add_legendw (HMGL
gr,const wchar_t *
text,const char *
style) Adds string text to internal legend accumulator. The style of described line and mark is specified in string style (see section Line styles). Maximal number of entries is 100.
- Method on
mglGraph
(C++, Python):void
ClearLegend () - C function:
void
mgl_clear_legend (HMGL
gr) Clears saved legend strings.
- Method on
mglGraph
(C++, Python):void
SetLegendBox (bool
enable) - C function:
void
mgl_set_legend_box (HMGL
gr,int
enable) Switch on/off drawing box near legend. By default (=
true
) box is drawn.
- Method on
mglGraph
(C++, Python):void
SetLegendMarks (int
num) - C function:
void
mgl_set_legend_marks (HMGL
gr,int
num) Set the number of marks in the legend. By default 1 mark is used.
- Obsolete option of mglGraph:
bool
LegendBox Switch on/off drawing box near legend. See
SetLegendBox()
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |