📄 added_line_options.hlp
字号:
{smcl}
{* 07mar2005}{...}
{cmd:help added_line_options}
{hline}
{* index adding lines}{...}
{* index adding lines, and see fits, adding}{...}
{* index lines, adding}{...}
{* index lines, adding, and see fits, adding}{...}
{* index yline() tt option}{...}
{* index xline() tt option}{...}
{* index tline() tt option}{...}
{title:Title}
{p2colset 5 31 33 2}{...}
{p2col :{hi:[G] {it:added_line_options}} {hline 2}}Options for adding lines to twoway graphs{p_end}
{p2colreset}{...}
{title:Syntax}
{it:added_line_options}{col 37}description
{hline 70}
{cmdab:yl:ine:(}{it:linearg}{cmd:)}{...}
{col 37}add horizontal lines at specified {it:y} values
{cmdab:xl:ine:(}{it:linearg}{cmd:)}{...}
{col 37}add vertical lines at specified {it:x} values
{cmdab:tl:ine:(}{it:time_linearg}{cmd:)}{...}
{col 37}add vertical lines at specified {it:t} values
{hline 70}
{pin}
{cmd:yline()}, {cmd:xline()}, and {cmd:tline()} are {it:merged-implicit}; see
{help repeated options} and see
{help added_line_options##remarks2:Interpretation of repeated options}
below.
{pstd}
where {it:linearg} is
{p 8 16 2}
{it:numlist}
[{cmd:,}
{it:suboptions}]
{pstd}
For a description of {it:numlist}, see {help numlist}.
{pstd}
and {it:time_linearg} is
{p 8 16 2}
{it:datelist}
[{cmd:,}
{it:suboptions}]
{pstd}
For a description of {it:datelist}, see {help datelist}.
{it:suboptions}{col 37}description
{hline 70}
{cmdab:ax:is:(}{it:#}{cmd:)}{...}
{col 37}which axis to use, 1 {ul:<} # {ul:<} 9
{cmdab:sty:le:(}{it:{help addedlinestyle}}{cmd:)}{...}
{col 37}overall style of added line
[{cmdab:no:}]{cmdab:ex:tend}{...}
{col 37}extend line through plot region's margins
{cmdab:lsty:le:(}{it:{help linestyle}}{cmd:)}{...}
{col 37}overall style of line
{cmdab:lp:attern:(}{it:{help linepatternstyle}}{cmd:)}{...}
{col 37}line pattern (solid, dashed, etc.)
{cmdab:lw:idth:(}{it:{help linewidthstyle}}{cmd:)}{...}
{col 37}thickness of line
{cmdab:lc:olor:(}{it:{help colorstyle}}{cmd:)}{...}
{col 37}color of line
{hline 70}
{title:Description}
{pstd}
{cmd:yline()}, {cmd:xline()}, and {cmd:tline()} are used with {cmd:twoway} to
add lines to the plot region. {cmd:tline()} is an extension to {cmd:xline()};
see {helpb tsline} for examples using {cmd:tline()}.
{title:Options}
{phang}
{cmd:yline()}, {cmd:xline()}, and {cmd:tline()} specify the {it:y}, {it:x},
and {it:t} (time) values where lines should be added to the plot.
{title:Suboptions}
{phang}
{cmd:axis(}{it:#}{cmd:)}
is for use only when multiple {it:y} or {it:x} (or {it:t}) axes are being
used (see {it:{help axis_choice_options}}). {cmd:axis()}
specifies to which axis the {cmd:yline()}, {cmd:xline()}, or {cmd:tline()}
is to be applied.
{phang}
{cmd:style(}{it:addedlinestyle}{cmd:)}
specifies the overall style of the added line, which includes
[{cmd:no}]{cmd:extend} and {cmd:lstyle(}{it:linestyle}{cmd:)}
documented below. The
[{cmd:no}]{cmd:extend} and {cmd:lstyle()} options allow you to change the
added line's attributes individually, but {cmd:style()} is the starting
point.
{pmore}
You need not specify {cmd:style()} just because there is something that
you want to change, and in fact, most people seldom specify the
{cmd:style()} option. You specify {cmd:style()} when
another style exists that is exactly what you desire or when another
style would allow you to specify fewer changes to obtain what you want.
{phang}
{cmd:extend} and {cmd:noextend}
specify whether the line should extend through the plot region's margin
and touch the axis; see {it:{help region_options}}.
Usually {cmd:noextend} is the default, and {cmd:extend} is the option,
but that is determined by the overall {cmd:style()} and, of course,
the scheme; see {help schemes}.
{phang}
{cmd:lstyle(}{it:linestyle}{cmd:)},
{cmd:lpattern(}{it:linepatternstyle}{cmd:)},
{cmd:lwidth(}{it:linewidthstyle}{cmd:)},
and
{cmd:lcolor(}{it:colorstyle}{cmd:)}
specify the look of the line; see {helpb line}.
{cmd:lstyle()} can be of particular use:
{pmore}
To create a line with the same look as the lines used to draw
axes, specify {cmd:lstyle(foreground)}.
{pmore}
To create a line with the same look as the lines used to draw
grid lines, specify {cmd:lstyle(grid)}.
{title:Remarks}
{pstd}
{cmd:yline()} and {cmd:xline()} add lines where specified. If, however, your
interest is in obtaining grid lines, see the {cmd:grid} option in
{it:{help axis_label_options}}.
{pstd}
Remarks are presented under the headings
{help added_line_options##remarks1:Typical use}
{help added_line_options##remarks2:Interpretation of repeated options}
{marker remarks1}{...}
{title:Typical use}
{pstd}
{cmd:yline()} or {cmd:xline()} are typically used to add reference values:
{cmd:. scatter yvar xvar, yline(10)}
{cmd:. scatter yvar year, xline(1944 1989)}
{pstd}
To give the line in the first example the same look as used to
draw an axis, we could specify
{phang2}
{cmd:. scatter yvar xvar, yline(10, lstyle(foreground))}
{pstd}
If we wanted to give the lines used in the second example the same look as used
to draw grids, we could specify
{phang2}
{cmd:. scatter yvar year, xline(1944 1989, lstyle(grid))}
{marker remarks2}{...}
{title:Interpretation of repeated options}
{pstd}
Options {cmd:yline()} and {cmd:xline()} may be repeated, and each is executed
separately. Thus different styles can be used for different lines on
the same graph:
{phang2}
{cmd:. scatter yvar year, xline(1944) xline(1989, lwidth(3))}
{title:Also see}
{psee}
Manual: {bf:[G] {it:added_line_options}}
{psee}
Online: {helpb twoway};
{it:{help datelist}};
{it:{help linestyle}},
{it:{help linepatternstyle}},
{it:{help linewidthstyle}},
{it:{help colorstyle}}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -