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 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 text 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 text 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”.
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.
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
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, Graph::addrect, and Graph::delete.
See also Graph::legend and Graph::textdefault.