Object Reference : Object View and Procedure Reference : Graph
  
 
addtext
Place text in graphs.
When adding text in one of the four predefined positions (left, right, top, bottom), EViews deletes any existing text that is in that position before adding the new text. Use the keep option to preserve the existing text.
Syntax
graph_name.addtext(options) "text"
Follow the addtext keyword with the text to be placed in the graph, enclosed in double quotes.
To include carriage returns in your text, use the control “\r” or “\n” to represent the return. Since the backslash “\” is a special character in the addtext command, use a double slash “\\” to include the literal backslash character.
Options
The following options may be provided to change the characteristics of the specified text object. Any unspecified options will use the default text settings of the graph.
 
font([face], [pt], [+/- b], [+/- i], [+/- u], [+/- s])
Set characteristics of text 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 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 text 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 text 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.
keep
When adding text to one of the predefined positions (left, right, top, bottom), any existing text in that position will be deleted and replaced with the new text. Use the “keep” option to preserve the existing text and place the second text object on top of the text in that position.
The following options control the position of the text:
 
t, ac
Top (above and centered over the graph).
l
Left rotated.
r
Right rotated.
b, bc
Below and centered over the graph.
bl
Below and left side of the graph.
br
Below and right side of the graph.
al
Above and left side of the graph.
ar
Above and right side of the graph.
ibl
Inside near the bottom left corner of the graph.
ibr
Inside near the bottom right corner of the graph.
itl
Inside near the top left corner of the graph.
itr
Inside near the top right corner of the graph.
just(arg)
Set the justification of the text, where arg may be: “c” (center), “l” (left - default), “r” (right).
x, lb
Enclose text in a large box.
sb
Enclose text in a small box.
The options which support the “–” may be preceded by a “+” or “–” indicating whether to turn on or off the option. The “+” is optional.
To place text within a graph, you can use explicit coordinates to specify the position of the upper left corner of the text.
Coordinates are set by a pair of numbers h, v in virtual inches. Individual graphs are always virtual inches (scatter diagrams are virtual inches) or a user-specified size, regardless of their current display size.
The origin of the coordinate is the upper left hand corner of the graph. The first number h specifies how many virtual inches to offset to the right from the origin. The second number v specifies how many virtual inches to offset below the origin. The upper left hand corner of the text will be placed at the specified coordinate.
Coordinates may be used with other options, but they must be in the first two positions of the options list. Coordinates are overridden by other options that specify location.
When addtext is used with a multiple graph, the text is applied to the whole graph, not to each individual graph.
Examples
freeze(g1) gdp.line
g1.addtext(t) "Fig 1: Monthly GDP (78m1-95m12)"
places the text “Fig1: Monthly GDP (78m1-95m12)” centered above the graph G1.
g1.addtext(.2, .2, X) "Seasonally Adjusted"
places the text “Seasonally Adjusted” in a box within the graph, slightly indented from the upper left corner.
g1.addtext(t, x, textcolor(red), fillcolor(128,128,128), framecolor(black)) "Civilian\rUnemployment (First\\Last)"
adds the text “Civilian Unemployment (First\Last)” where there is a return between the “Civilian” and “Unemployment”. The text is colored red, and is enclosed in a gray box with a black frame.
Cross-references
See “Adding and Editing Text” for discussion.
See Graph::addarrow, Graph::addellipse and Graph::addrect. See also Graph::legend and Graph::textdefault.