Object Reference : Object View and Procedure Reference : Graph
  
 
legend
Set legend appearance and placement in graphs.
When legend is used with a multiple graph, the legend settings apply to all graphs. See Graph::setelem for setting legends for individual graphs in a multiple graph.
Syntax
graph_name.legend option_list
Options
 
columns(arg) (default=“auto”)
Columns for legend: “auto” (automatically choose number of columns), int (put legend in specified number of columns).
display/–display
Display/do not display the legend.
inbox/–inbox
Put legend in box/remove box around legend.
position(arg)
Position for legend: “left” or “l” (place legend on left side of graph), “right” or “r” (place legend on right side of graph), “botleft” or “bl” (place left-justified legend below graph), “botcenter” or “bc” (place centered legend below graph), “botright” or “br” (place right-justified legend below graph), “(h, v)” (the first number h specifies the number of virtual inches to offset to the right from the origin. The second number v specifies the virtual inch offset below the origin. The origin is the upper left hand corner of the graph).
font([face], [pt], [+/- b], [+/- i], [+/- u], [+/- s])
Set characteristics of legend font. The font name (face), size (pt), and characteristics are all optional. face should be a valid font name, enclosed in double quotes. pt should be the font size in points. The remaining options specify whether to turn on/off boldface (b), italic (i), underline (u), and strikeout (s) styles.
textcolor(arg)
Sets the color of the legend text. arg may be one of the predefined color keywords, or it may be specified using individual red-green-blue (RGB) components using the “@RGB” or “@HEX” functions. The arguments to the @RGB function are a set of three integers from 0 to 255, representing the RGB values of the color. The arguments to the “@HEX” function are a set of six characters representing the RGB values of the color in hexadecimal. Each two character set represents a red, green or blue component in the range '00' to 'FF'. For a description of the available color keywords see “Color definitions”.
fillcolor(arg)
Sets the background fill color of the legend box. arg may be one of the predefined color keywords, or it may be specified using individual red-green-blue (RGB) components using the “@RGB” or “@HEX” functions. The arguments to the @RGB function are a set of three integers from 0 to 255, representing the RGB values of the color. The arguments to the “@HEX” function are a set of six characters representing the RGB values of the color in hexadecimal. Each two character set represents a red, green or blue component in the range '00' to 'FF'. For a description of the available color keywords see “Color definitions”.
framecolor(arg)
Sets the color of the legend box frame. arg may be one of the predefined color keywords, or it may be specified using individual red-green-blue (RGB) components using the “@RGB” or “@HEX” functions. The arguments to the @RGB function are a set of three integers from 0 to 255, representing the RGB values of the color. The arguments to the “@HEX” function are a set of six characters representing the RGB values of the color in hexadecimal. Each two character set represents a red, green or blue component in the range '00' to 'FF'. For a description of the available color keywords see “Color definitions”.
The options which support the “–” may be preceded by a “+” or “–” indicating whether to turn on or off the option. The “+” is optional.
The default settings are taken from the global defaults.
Color definitions
color_arg specifies the color to be employed in the arguments above. The color may be specified using predefined color names, by specifying the individual red-green-blue (RGB) components using the special “@RGB” function, or by specifying the individual red-green-blue (RGB) components in hexadecimal using the special “@HEX” function.
The predefined colors are given by the keywords (with their RGB and HEX equivalents):
 
blue
@rgb(0, 0, 255)
@hex(0000ff)
red
@rgb(255, 0, 0)
@hex(ff0000)
ltred
@rgb(255, 168, 168)
@hex(ffa8a8)
green
@rgb(0, 128, 0)
@hex(008000)
black
@rgb(0, 0, 0)
@hex(000000)
white
@rgb(255, 255, 255)
@hex(ffffff)
purple
@rgb(128, 0, 128)
@hex(800080)
orange
@rgb(255, 128, 0)
@hex(ff8000)
yellow
@rgb(255, 255, 0)
@hex(ffff00)
gray
@rgb(128, 128, 128)
@hex(808080)
ltgray
@rgb(192, 192, 192)
@hex(c0c0c0)
Examples
mygra1.legend display position(l) inbox
places the legend of MYGRA1 in a box to the left of the graph.
mygra1.legend position(.2,.2) -inbox
places the legend of MYGRA1 within the graph, indented slightly from the upper left corner with no box surrounding the legend text.
mygra1.legend font("Times", 12, b, i) textcolor(red) fillcolor(blue) framecolor(blue)
sets the legend font to red “Times” 12pt bold italic, and changes both the legend fill and frame colors to blue.
Cross-references
See “Graph Objects” for a discussion of graph objects in EViews.
See Graph::addtext and Graph::textdefault. See Graph::setelem for changing legend text and other graph options.