void legend (marker, string, style, strhgt, scolor) LEGEND.C Level 1
 
int marker = 0 if the legend entry is to be a symbol.
= 1 if the entry is to be a line style.
= 2 if the entry is a panel fill pattern.
char *string The text description of the entry.
int style The symbol or line style number or a panel pattern for the entry.
float strhgt The height of the text in inches (or cm).
int scolor The color for the line, symbol, or panel border.
 
A separate call to legend() is necessary for each entry in the legend.

If you are plotting curves and use the legend making feature, the line styles and colors will automatically change from curve to curve. The first call to curve() goes with the first legend entry, and so on.

With bar charts, the bar colors will change to match the legend entries when plotting stacked or offset bars. The first x value for a given cluster of bars will match the first legend entry, and so on. See bar(). ColorKeyL() and ColorKeyN() can also be used to make legends keyed to panel fill or line colors.

To turn off the automatic feature call autolegend(0). See also legpos().