G7 Commands: L¶
- (le)gend <a> [<b>]
The (le)gend command controls printing a legend at the bottom of a graph.
- <a> = y:
for yes, prints the legend (default)
- <a> = n:
for no, do not print the legend
- <a> = s:
leave space for legend but do not print. It allows the user to annotate the legend.
- <b> = y:
for yes, mark the dates (default)
- <b> = n:
for no, do not mark dates. It is used to make bar graphs of data occurring at arbitrary intervals.
Related Topics: Drawing graphs in G7 graph
Related Topics: graph
Example:
lim 1975.1 2010.4 2015.3If valid dates have been specified, then they can be adjusted, moving either or both dates either forward or backward in time.
Example:
lim +0 -2 +1If the command above follows the command in the first example, then the adjusted limits specify the period quarter one of 1975 through quarter 2 of 2010, and a forecast period through quarter four of 2015.
GRAPH.SET
line 1
255
2
+
0
0
0.000
1.000
line 2
16711680
2
s
1
0
0.000
1.000
line 3
32768
2
x
2
0
0.000
1.000
line 4
16776960
2
d
3
0
0.000
1.000
line 5
8388736
2
^
4
0
0.000
1.000
line 6
8388608
2
v
0
0
0.000
1.000
line 7
5315660
2
n
0
0
0.000
1.000
Alternatively, providing the line command followed by a single “linenumber” argument causes the settings for the corresponding line to be printed to screen. Settings for up to 7 series can be specified by the line command. The first argument, <linenumber>, corresponds to the series given in that position on the gr command line. The first series after gr is line 1. The second argument, <color_number>, can be a decimal number representing the components of red, green and blue of the color, or it can be a color name. The third argument, <thickness>, may be set to anything you like, but something in the range of 2 to 4 generally is pleasing. The fourth argument specifies the type of marker on the line, if any. Here is a short table of the possible characters for this argument, and what they mean:
Symbol
Meaning
+
Plus signs
x
X marker
s
Square
d
Diamond
>
Arrow in direction of line
v
Downware pointing triangles
b
Bars
f
Bars with no surrounding rectangle
The next argument is the <style> of the line, possible numeric values for this argument are:
Value
Meaning
0
Solid
1
Dashed
2
Dotted
3
Dash dot
4
Dash dot dot
5
Clear (blank line)
The next argument, <barfill> indicates the type of fill pattern that a bar will take, if a bar graph has been chosen. Possible numeric values for this are:
Value
Meaning
0
Solid fill
1
Clear (empty)
2
Horizontal lines
3
Vertical lines
4
Forward diagonal fill (/////)
5
Backward diagonal fill (\\\\\)
6
Cross hatch
7
Diagonal cross hatch
The <left> and <right> parameters, must be between 0 and 1. They show where, within the space allocated for the bar, the left and right edges of the bar go. For example, with left = 0.1 and right = 0.9, the bar will be in the center of the allowed space, and the bars will be four times as wide (0.8 units) as the space between them (0.2 units). To eliminate the line connecting points marked by bars, set its width to zero. Parallel bars are drawn by assigning non-overlapping intervals to different series. Stacked bars or high-low graphs are produced with overlapping intervals. The table below shows some of the legal color names. Color names may be capitalized or not. Where names have “light” or “dark” these can be abbreviated as “lt” or “dk”. For example, “Lightgray” is the same as “ltgray”.
Basic
Light/Dark
Others
black
lightgray
olive
pumpkin
white
darkgray
lavender
seagreen
red
darkblue
forest
chocolate
green
darkred
aqua
slategray
blue
darkgreen
chartreuse
skyblue
yellow
lightblue
maroon
tomato
orange
lightred
fuchsia
teal
purple
lightgreen
azure
coral
brown
darkbrown
midnight gold
Related Topics: Drawing graphs, Graph settings, vr
Example:
lint pce1This example loads the pce vector and then fills in the missing values in sector 1 by linear interpolation. We could similarly fill in the values for all the sectors in the present dynamic group by
load pce lint :or all the values for the static group Services by:
load pce lint :ServicesEntire matrices may be interpolated with one command. For example,
lint amwill interpolate the entire am matrix. This interpolation also works for packed matrices. The lint command works on the entire range of the Vam file without regard to fdates.
Related Topics: group
- linv [bank letter.]<matrix A> [period]
The linv command calculates the Leontief inverse and places it in the source matrix. It works over the current fdates, or for the [period] specified on the command line.
For example,
linv A 1995
replaces A with its Leontief inverse for 1995.
Related Topics: Matrix operations, madd, mcopy, minv, mmult, mtrans, vc
- listbanks (lb)
This function provides information about the banks that are currently assigned in G7. Up to 25 banks of various types may be assigned, to positions ‘a’ through ‘z’ except ‘w’. The lb command reviews which banks are assigned to which position and what type of bank they are.
Related Topics: Assigned banks, bank, cbk, dfr, findmode, hbk, vam
- (listg)roups
List the names of all groups currently in the GROUPS.BIN file.
- (lis)tnames [-srgv] [-l <root>] <bank_location> [wildcard]
Displays the series names in the workspace (w) or the assigned bank (a). For example,
lis a
This command also has a “wildcard” option, which allows you to list variable names matching a certain pattern. For example,
lis a out*
will list all series in the assigned bank that start with out (such as out1 through out85).
Option ‘s’ sorts the series in alphabetical order, and ‘r’ reverses the order. If a Vam file is associated with the G bank, then option ‘g’ prints only macro series and option ‘v’ prints only Vam bank series. If the ‘l’ option is specified and a root name is provided, then the a set of strings will be defined. The string names will be constructed as the root name followed an integer, and the string definition will be the name of the series. One string will be created for each series in the bank.
Related Topics: listnamescol
- load <vector_name>
When G7 is working on a vector in a Vam file, it pulls the whole time series for the vector into a sort of vector workspace. Usually, this is done implicitly simply by referring to the vector or one of its elements. The load command enables the user to do this loading explicitly. It is used principally in connection with the index command described below.
Example:
load pce
Related Topics: store
- look <bank_location>
This command from the G7 console is equivalent to the Bank | Look menu command. As usual, <bank_location> is a letter between ‘a’ and ‘z’ to which you have assigned the bank you would like to look at. For look to work, there must be a stub file created with the same root name as the bank. For example, the stub file for the NIPAA.HBK, databank, which is a hashed bank, is NIPAA.STB.
The look command brings up the stub file in a scrolling list box, from which you can select lines of the file to print out and graph the various series in the bank. If you double-click on the series name, the series will be printed out using the current graph dates (gdates), and the title of the graph will be the line of the stub file. The series also will be printed to the G7 console.
Related Topics: Dates in G7, Stub Files, gdates, graph, tdates
- ls [-<flag>] <x> <y> <date1> [<date2>] [direction]
This linkseries command takes series <x> and <y> from the workspace or the assigned bank, calculates their ratio at the specified linking date <date1>. This ratio then is used to move <x> with non-zero entries from series <y>. The linking direction can be ‘f’ for forward or ‘b’ for backward. The default is ‘f’. If the variable <x> is found in the workspace, then the result is stored with name <x> in the workspace. If a bank letter is provided for <x>, and if this bank is the default Vam file, then the modified value of <x> is stored in the Vam file. Otherwise, the result is stored to the workspace. If the optional date <date2> is provided, then linking will extend from the base period <date1> to the terminal period <date2>. <date2> is the last period (if the direction is ‘f’) or first period (if the direction is ‘b’) that will be modified. If not given, then the values will be modified to the end of the series, with no regard for the fdates settings that ordinarily will limit the extent of operations.
If the signs of the values in x and y are not the same, then the result will move in the opposite direction of the guide series; this usually is not desirable and a warning will be given. Three alternatives to the basic routine may be implemented by using a flag.
- -f:
the calculation using standard algorithm without reporting problems.
- -i:
if x and y are of opposite sign in the base year, then ensure positive correlation between x and y such that
x = a + b*y b = x{date} / y{date} * sign( x{date}*y{date} ) a = x{date} - b * y{date}
- -a:
- if x and y are of opposite sign in the base year, and the problem is ill-conditioned such that y lies close to zero in the link year, then ensure positive correlation between x and y such that
x = a + b*y b = x{date}/ AVG(y) * sign( x{date}*AVG(y) ) a = x{date} - b * y{date}
where AVG(y) is calculated from fdate1 to <date>, if direction is ‘b’, or from <date> to fdate2, if direction is ‘f’. This may be useful when y{date} is close to zero so that scaling parameter b is large, thus scaling x excessively. If AVG(y) is close to zero, then b = x{date} * sign( x{date}*AVG(y) ). It is the user’s responsibility to ensure that the results are useful.
Related Topics: @bmk function