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 made up of n1, n2, n3, a set of three integers from 0 to 255, representing the RGB values of the color. For a description of the available color keywords (“blue”, “red”, “green”, “black”, “white”, “purple”, “orange”, “yellow”, “gray”, “ltgray”), see Table::setfillcolor.
fillcolor(arg)
Sets the background fill color of the legend box. arg may be one of the predefined color keywords, or it may be made up of n1, n2, n3, a set of three integers from 0 to 255, representing the RGB values of the color. For a description of the available color keywords (“blue”, “red”, “green”, “black”, “white”, “purple”, “orange”, “yellow”, “gray”, “ltgray”), see Table::setfillcolor.
framecolor(arg)
Sets the color of the legend box frame. arg may be one of the predefined color keywords, or it may be made up of n1, n2, n3, a set of three integers from 0 to 255, representing the RGB values of the color. For a description of the available color keywords (“blue”, “red”, “green”, “black”, “white”, “purple”, “orange”, “yellow”, “gray”, “ltgray”), see Table::setfillcolor.
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.
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.