📄 axis_title_options.hlp
字号:
{smcl}
{* 05mar2005}{...}
{cmd:help axis_title_options}
{hline}
{* index ttitle() tt option}{...}
{* index xtitle() tt option}{...}
{* index ytitle() tt option}{...}
{* index axis titling}{...}
{* index axis titling, suppressing}{...}
{title:Title}
{p2colset 5 31 33 2}{...}
{p2col :{hi:[G] {it:axis_title_options}} {hline 2}}Options for specifying axis titles{p_end}
{p2colreset}{...}
{title:Syntax}
{pstd}
{it:axis_title_options} are a subset of {it:axis_options}; see
{it:{help axis_options}}.
{it:axis_title_options} control the titling of an axis.
{it:axis_title_options}{col 43}description
{hline 70}
{cmdab:yti:tle:(}{it:axis_title}{cmd:)}{...}
{col 43}specify {it:y} axis title
{cmdab:xti:tle:(}{it:axis_title}{cmd:)}{...}
{col 43}specify {it:x} axis title
{cmdab:tti:tle:(}{it:axis_title}{cmd:)}{...}
{col 43}specify {it:t} (time) axis title
{hline 70}
{pin}
The above options are {it:merged-explicit}; see {help repeated options}.
{pstd}
where {it:axis_title} is
{p 8 16 2}
{cmd:"}{it:string}{cmd:"} [{cmd:"}{it:string}{cmd:"} [...]]
[{cmd:,} {it:suboptions}]
{it:suboptions}{col 43}description
{hline 70}
{cmd:axis(}{it:#}{cmd:)}{...}
{col 43}which axis, 1 {ul:<} {it:#} {ul:<} 9
{cmd:prefix}{...}
{col 43}combine options
{cmd:suffix}{...}
{col 43}combine options
{it:{help textbox_options}}{...}
{col 43}control details of text appearance
{col 43}see {it:{help textbox_options}}
{hline 70}
{title:Description}
{pstd}
{it:axis_title_options} specify the titles to appear on axes.
{title:Options}
{phang}
{opt ytitle(axis_title)}, {opt xtitle(axis_title)}, and
{opt ttitle(axis_title)} specify the titles to appear on the {it:y}, {it:x},
and {it:t} axes. {cmd:ttitle()} is a synonym for {cmd:xtitle()}.
{title:Suboptions}
{phang}
{cmd:axis(}{it:#}{cmd:)}
specifies to which axis this title belongs and is specified when dealing
with multiple {it:y} or multiple {it:x} axes; see
{it:{help axis_choice_options}}.
{phang}
{cmd:prefix} and {cmd:suffix}
specify
that what is specified in this option is to be added to any previous
{cmd:xtitle()} or {cmd:ytitle()} options previously specified.
See {hi:Interpretation of repeated options} below.
{phang}
{it:textbox_options}
specifies the look of the text. See {it:{help textbox_options}}.
{title:Remarks}
{pstd}
{it:axis_title_options} are a subset of {it:axis_options};
see {it:{help axis_options}} for an overview.
The other appearance options are
{it:axis_scale_options}{right:(see {it:{help axis_scale_options}}) }
{it:axis_label_options}{right:(see {it:{help axis_label_options}}) }
{pstd}
Remarks are presented under the headings
{help axis_title_options##remarks1:Default axis titles}
{help axis_title_options##remarks2:Overriding default titles}
{help axis_title_options##remarks3:Specifying multiline titles}
{help axis_title_options##remarks4:Suppressing axis titles}
{help axis_title_options##remarks5:Interpretation of repeated options}
{help axis_title_options##remarks6:Titles with multiple y axes or multiple x axes}
{marker remarks1}{...}
{title:Default axis titles}
{pstd}
Even if you do not specify the
{cmd:ytitle()} or {cmd:xtitle()}
options, in most cases axes will
be titled. In those cases,
{c -(}{cmd:y}|{cmd:x}{c )-}{cmd:title()}
changes the title.
If an axis is not titled, specifying
{c -(}{cmd:y}|{cmd:x}{c )-}{cmd:title()}
adds a title.
{pstd}
Default titles are obtained using the corresponding variable's variable label
or, if it does not have a label, using its name. For instance, in
{cmd:. twoway scatter yvar xvar}
{pstd}
the default title for the {it:y} axis will be obtained from variable yvar, and
the default title for the {it:x} axis will be obtained from xvar. In some
cases, the plottype substitutes a different title; for instance,
{cmd:. twoway lfit yvar xvar}
{pstd}
labels the {it:y} axis "Fitted values" regardless of the name or variable
label associated with variable yvar.
{pstd}
If multiple variables are associated with the same axis, their individual
titles (variable label, variable name, or as substituted) are joined, with a
slash ({cmd:/}) in between. For instance, in
{phang2}
{cmd:. twoway scatter y1var xvar || line y2var xvar || lfit y1var xvar}
{pstd}
the {it:y} axis will be titled
{it:y1var_title}/{it:y2var_title}/Fitted values
{pstd}
When many plots are overlaid, this often results in titles that run off the
end of the graph.
{marker remarks2}{...}
{title:Overriding default titles}
{pstd}
You may specify the title to appear on the {it:y} axis using {cmd:ytitle()}
and the title to appear on the {it:x} axis using {cmd:xtitle()}. You
specify the text{hline 2}surrounded by double quotes{hline 2}inside the option:
{cmd:ytitle("My y title")}
{cmd:xtitle("My x title")}
{pstd}
In the case of {cmd:scatter}, the command might read
{phang2}
{cmd:. scatter yvar xvar, ytitle("Price") xtitle("Quantity")}
{marker remarks3}{...}
{title:Specifying multiline titles}
{pstd}
Titles may include more than one line. Lines are specified one after the
other, each enclosed in double quotes:
{cmd:ytitle("First line" "Second line")}
{cmd:xtitle("First line" "Second line" "Third line")}
{marker remarks4}{...}
{title:Suppressing axis titles}
{pstd}
To eliminate an axis title altogether, specify
{c -(}{cmd:y}|{cmd:x}{c )-}{cmd:title("")}.
{pstd}
To eliminate the title on a second, third, ..., axis, specify
{c -(}{cmd:y}|{cmd:x}{c )-}{cmd:title("", axis(}{it:#}{cmd:))}.
See {hi:Titles with multiple y axes or multiple x axes} below.
{marker remarks5}{...}
{title:Interpretation of repeated options}
{pstd}
{cmd:xtitle()} and {cmd:ytitle()} may be specified more than once in
the same command. When you do that, the rightmost one takes effect.
{pstd}
See {hi:Interpretation of repeated options} in
{it:{help axis_label_options}}. Multiple {cmd:ytitle()} and {cmd:xtitle()}
options work the same way. The twist in the case of the title options is that
you specify whether the extra information is to be prefixed or suffixed onto
what came before.
{pstd}
For instance, pretend that {cmd:sts graph} produced the {it:x} axis title
"analysis time". If you typed
{cmd:. sts graph, xtitle("My new title")}
{pstd}
the title you specified would replace that. If you typed
{cmd:.sts graph, xtitle("in days", suffix)}
{pstd}
the {it:x} axis title would be (first line) "analysis time" (second line)
"in days". If you typed
{phang2}
{cmd:.sts graph, xtitle("Time to failure", prefix)}
{pstd}
the {it:x} axis title would be (first line) "Time to failure" (second line)
"analysis time".
{marker remarks6}{...}
{title:Titles with multiple y axes or multiple x axes}
{pstd}
When you have more than one {it:y} or {it:x} axis (see
{it:{help axis_choice_options}}), remember to specify the
{cmd:axis(}{it:#}{cmd:)} suboption to indicate to which axis you are
referring.
{title:Also see}
{psee}
Manual: {bf:[G] {it:axis_title_options}}
{psee}
Online: {it:{help axis_options}};
{it:{help axis_label_options}},
{it:{help axis_scale_options}}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -