| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
8.10 Legend (Pure C)
These functions draw legend to the graph (useful for 1D plotting (Pure C)). Legend entry is a pair of strings: one for style of the line, another one with description text (with included LaTeX parsing). The array of string are accumulated first to the internal arrays (by function AddLegend()) and are plotted later. 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 (default value is 0.1). If line style string for entry is empty then the corresponding text is printed without indent. See section Legend sample, for sample code and picture.
- C function:
voidmgl_legend (HMGLgr,intwhere,const char *font,floatsize,floatllen) 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).
- C function:
voidmgl_legend_xy (HMGLgr,floatx,floaty,const char *font,floatsize,floatllen) 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].
- C function:
voidmgl_add_legend (HMGLgr,const char *text,const char *style) - C function:
voidmgl_add_legendw (HMGLgr,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.
- C function:
voidmgl_set_legend_box (HMGLgr,intenable) Switch on/off drawing box near legend. By default (=
true) box is drawn.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
