Object Reference : Object View and Procedure Reference : Graph
  
 
setelem
Set individual line, bar and legend options for each series in the graph.
Syntax
graph_name.setelem(graph_elem) argument_list
where graph_elem is the identifier for the graph element whose options you wish to modify:
 
integer
Index for graph element (for non-boxplot graphs). For example, if you provide the integer “2”, EViews will modify the second line in the graph.
box_elem
Boxplot element to be modified: box (“b”), median (“med”), mean (“mean”), near outliers (“near” or “no”), far outliers (“far” or “fo”), whiskers (“w”), staples (“s”). For boxplot graphs only.
The argument list for setelem may contain one or more of the following:
 
symbol(arg)
Sets the drawing symbol: arg can be an integer from 1–18, or one of the matching keywords. “obslabel” and “dotobslabel”, and “dotobslabelcircle” use the observation label as the symbol.
Selecting a symbol automatically turns on symbol use.
The “none” option turns off symbol use.
symbolsize(arg), symsize(arg)
Sets the symbol size. arg may be an integer between 1-8, where 1 is the smallest symbol and 8 is the largest, or
one of the keywords: “XS” (X-Small), “S” (Small), “M” (Medium), “L” (Large), “XL” (X-Large), “2XL” (2X-Large), “3XL” (3X-Large), “4XL” (4X-Large).
linecolor(arg), lcolor(arg)
Sets the line and symbol color. 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”.
linewidth(n1), lwidth(n1)
Sets the line and symbol width: n1 should be a number between “.25” and “5”, indicating the width in points.
linepattern(arg), lpat(arg)
Sets the line pattern to the type specified by arg. arg can be an integer from 1–12 or one of the matching keywords.
Note that the option interacts with the graph options for “color”, “lineauto”, “linesolid”, “linepat” (see Graph::options, for details). You may need to set the graph option for “linepat” to enable the display of line patterns. See Graph::options.
Note also that the patterns with index values 7–11 have been modified since version 5.0. In particular, the “none” option has been moved to position 12.
The “none” option turns off lines and uses only symbols.
lineopacity(arg),
Sets the line opacity to the value specified by arg. arg can be an value from 0 to 1.
Setting the level to 0.0 will make the object completely transparent (0% opacity) while a value of 1.0 will make the object completely opaque (100% opacity).
fillcolor(arg), fcolor(arg)
Sets the fill color for symbols, bars, and pies. arg may be one of the predefined color keywords, or it may be specified using individual red-green-blue (RGB) components using the “@RGB” function 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”.
fillgray(n1), gray(n1)
Sets the gray scale for bars and pies: n1 should be an integer from 1–15 corresponding to one of the predefined gray scale settings (from lightest to darkest).
fillhatch(arg), hatch(arg)
Sets the hatch characteristics for bars and pies: arg can be an integer from 1–7, or one of the matching keywords.
fillopacity(arg),
Sets the fill opacity to the value specified by arg. arg can be an value from 0 to 1.
Setting the level to 0.0 will make the object completely transparent (0% opacity) while a value of 1.0 will make the object completely opaque (100% opacity).
preset(n1)
Sets line and fill characteristics to the specified EViews preset values, where n1 is an integer from 1–30. Simultaneously sets “linecolor”, “linepattern”, “linewidth”, “symbol”, “fillcolor”, “fillgray”, and “fillhatch” to the EViews predefined definitions for graph element n1.
When applied to boxplots, the line color of the specified element will be applied to the box, whiskers, and staples.
default(n1)
Sets line and fill characteristics to the specified user-defined default settings where n1 is an integer from 1–30. Simultaneously sets “linecolor”, “linepattern”, “linewidth”, “symbol”, “fillcolor”, “fillgray”, and “fillhatch” to the values in the user-defined global defaults for graph element n1.
When applied to boxplots, the line color of the specified settings will be applied to the box, whiskers, and staples.
axis(arg), scale(arg)
Assigns the element to an axis: left (“l”), right (“r”), bottom (“b”), top (“t”). The latter two options are only applicable for XY and scatter graphs ( scat, xyarea, xybar, xyline, xypair).
legend(str)
Assigns legend text for the element. str will be used in the legend to label the element.
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
graph1.setelem(2) lcolor(blue) lwidth(2) symbol(circle)
sets the second line of GRAPH1 to be a blue line of width 2 with circle symbols.
graph1.setelem(1) lcolor(blue)
graph1.setelem(1) linecolor(0, 0, 255)
are equivalent methods of setting the linecolor to blue.
graph1.setelem(1) fillgray(6)
sets the gray-scale color for the first graph element.
The lines:
graph1.setelem(1) scale(l)
graph1.setelem(2) scale(l)
graph1.setelem(3) scale(r)
create a dual scale graph where the first two series are scaled together and labeled on the left axis, and the third series is scaled and labeled on the right axis.
graph1.setelem(2) legend("gross domestic product")
sets the legend for the second graph element.
Cross-references
See “Graph Objects” for a discussion of graph options in EViews.
See also Graph::axis, Graph::datelabel and Graph::options.