Stata 15 help for gr7axes

help gr7axes (out-of-date command) -------------------------------------------------------------------------------


This help file documents the old version of Stata's graph command. See graph for the modern version.

Stata runs the old version of graph whenever graph is invoked under version control (see version) or when you use the graph7 or gr7 command.

graph7 command common options -- title and axes options

{graph7 | gr7} [varlist] [weight] [if exp] [in range] [, graph_type specific_options common_options]

The title and axes common_options are

noaxis [no]border gap(#) log ylog xlog rlog

title("text") t1title("text") t2title("text") b1title("text") b2title("text") l1title("text") l2title("text") r1title("text") r2title("text")

key1([symbol] [connect] [pen] ["text"]) key2([symbol] [connect] [pen] ["text"]) key3([symbol] [connect] [pen] ["text"]) key4([symbol] [connect] [pen] ["text"])

xlabel[(numlist)] ylabel[(numlist)] rlabel[(numlist)] tlabel[(numlist)]

xtick[(numlist)] ytick[(numlist)] rtick[(numlist)] ttick[(numlist)]

xscale(#[,]#) yscale(#[,]#) rscale(#[,]#)

Information on the graph7 command and the different graph_types is found in graph7. This entry details the title and axes common_options. Help for the other common_options is also available. See gr7sym for symbols and lines; help gr7color for color and shading; gr7other for saving, printing, and multiple images.


noaxis requests that no axis be drawn.

[no]border requests or suppresses a border-style axis. border requests the border style. On occasion, graph7 may decide by itself that a border would look better. On those occasions, noborder requests that only an axis be drawn. "graph7 y x, border" graph7 y versus x with a border-style axis.

border is also used with matrix (see gr7matrix) to indicate that the diagonal entries are to be bordered.

Borders, like axes, are always drawn using pen 1.

gap(#) sets the amount of space between the left title and the values along the axis on any style that includes an axis. The default is 8 although it "should be" 9. If it were 9, the value labels could never run into the left title. In most cases, however, 8 is sufficient and 9 results in too much space to be aesthetically pleasing. You can close or widen the gap.

log, ylog, xlog, and rlog specify log scales. log is used for histogram (see gr7hist) and the remaining options are used for twoway (see gr7twoway). rlog refers to the right scale and is allowed only in twoways with two vertical scales. The values of all labels, ticks, lines, etc., are specified in natural (unlogged) units.

Examples: . graph7 y, log . graph7 y x, ylog xlog . graph7 y x, ylog . graph7 y x, xlog . graph7 y1 y2 x, rescale rlog

title("text") adds a title in large letters at the bottom of the graph. Usually, the quotes can be omitted if text contains no special characters. If the text itself contains quotes then compound double quotes (`" and "') must be used.

Examples: . graph7 y x, title(Figure 1. Raw data) . graph7 y x, title("Figure 1. Raw data") . graph7 y x, title(`"Figure 1. "Raw" data"')

t1title("text"), t2title("text"), b1title("text"), b2title("text"), l1title("text"), l2title("text"), r1title("text"), and r2title("text") are more titling options. There are two titles on every side of the figure. The sides are referred to as top, bottom, left, and right. b1title() is also known as simply the title(). These title options can be abbreviated by their first two characters. b2() is the same as b2title(). The first (#1) title on a side is always farther from the figure.

key1([symbol] [connect] [pen] ["text"]), key2([symbol] [connect] [pen] ["text"]), key3([symbol] [connect] [pen] ["text"]), and key4([symbol] [connect] [pen] ["text"]) specify a key to appear at the top of the graph in the area of t1title() and t2title(). Specify symbol as symbol(s) and specify connect as connect(c[[p]]), see gr7sym. Specify pen as p(#), see gr7color.

There are four total keys that can be specified. If no titles are specified, Stata produces default key definitions. These definitions can be specified by the user by using key1(), key2(), key3(), and key4(). If you have multiple keys and specify one of them, you must specify as many as you have if you wish to display all your keys. No default keys are generated once a key#() is specified.

xlabel[(numlist)], ylabel[(numlist)], rlabel[(numlist)], and tlabel[(numlist)] specify axes labels. graph7 usually labels just the minimums and maximums of the data. On any style that has a numeric x axis, such as histogram (see gr7hist) or twoway (see gr7twoway), you can specify xlabel. Without arguments, graph7 will choose "round" values for you; with arguments, the values you specify will be labeled. ylabel, rlabel, and tlabel work similarly. ylabel refers to the y axis; rlabel to the right axis (if there is one), and tlabel to the top axis (if there is one).

"graph7 y x, ylabel xlabel" plots y versus x with round labeling of the axes.

"graph7 y x, ylabel xlabel(0 10 to 40)" does the same except the values 0, 10, ..., 40 are labeled on the x axis.

These options are not allowed with matrix (see gr7matrix). Instead, the label option, which allows no arguments, provides round labels.

xtick[(numlist)], ytick[(numlist)], rtick[(numlist)], and ttick[(numlist)] place tick marks on axes. By default, graph7 places tick marks wherever axes are labeled, so these options allow specifying additional ticking. xtick, ... options work like the xlabel, ... options described above.

xscale(#[,]#), yscale(#[,]#), and rscale(#[,]#) can widen, but never narrow, the scale of the axes. By default, graph7 chooses to scale each axis according to the minimum and maximum of all things that go on the axis. This includes the data and any labeling or ticking you specify. These options add two more numbers to this calculation. Either can be specified as "." to indicate that it is unchanged from what graph7 otherwise would have chosen.

Suppose x range from 1 to 9. "graph7 y x, xscale(.,5)" will have no effect on the scale: It will not graph solely the data for which x is between 1 and 5. "graph7 y x if x<=5" will have the desired effect.

"graph7 y x, xscale(0,.)" would make the x-scale 0 to 9. "graph7 y x, xscale(.,10)" would make the x-scale 1 to 10. "graph7 y x, xscale(0,10)" would make the x-scale 0 to 10.

Also see

Help: [G-2] graph7, gr7bar, gr7box, gr7color, gr7hist, gr7matrix, gr7oneway, gr7other, gr7pie, gr7star, gr7sym, gr7twoway

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index