Stata 15 help for axis_title_options

[G-3] axis_title_options -- Options for specifying axis titles

Syntax

axis_title_options are a subset of axis_options; see [G-3] axis_options. axis_title_options control the titling of an axis.

axis_title_options Description ------------------------------------------------------------------------- ytitle(axis_title) specify y axis title xtitle(axis_title) specify x axis title ttitle(axis_title) specify t (time) axis title ztitle(axis_title) specify contour legend axis title ------------------------------------------------------------------------- The above options are merged-explicit; see repeated options.

where axis_title is

"string" ["string" [...]] [, suboptions]

string may contain Unicode characters and SMCL tags to render mathematical symbols, italics, etc.; see [G-4] text.

suboptions Description ------------------------------------------------------------------------- axis(#) which axis, 1 < # < 9 prefix combine options suffix combine options textbox_options control details of text appearance; see [G-3] textbox_options -------------------------------------------------------------------------

Description

axis_title_options specify the titles to appear on axes.

Options

ytitle(axis_title), xtitle(axis_title), and ttitle(axis_title) specify the titles to appear on the y, x, and t axes. ttitle() is a synonym for xtitle().

ztitle(axis_title); see Contour axes -- ztitle() below.

Suboptions

axis(#) specifies to which axis this title belongs and is specified when dealing with multiple y or multiple x axes; see [G-3] axis_choice_options.

prefix and suffix specify that what is specified in this option is to be added to any previous xtitle() or ytitle() options previously specified. See Interpretation of repeated options below.

textbox_options specifies the look of the text. See [G-3] textbox_options.

Remarks

axis_title_options are a subset of axis_options; see [G-3] axis_options for an overview. The other appearance options are

axis_scale_options (see [G-3] axis_scale_options)

axis_label_options (see [G-3] axis_label_options)

Remarks are presented under the following headings:

Default axis titles Overriding default titles Specifying multiline titles Suppressing axis titles Interpretation of repeated options Titles with multiple y axes or multiple x axes Contour axes -- ztitle()

Default axis titles

Even if you do not specify the ytitle() or xtitle() options, axes will usually be titled. In those cases, {y|x}title() changes the title. If an axis is not titled, specifying {y|x}title() adds a title.

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

. twoway scatter yvar xvar

the default title for the y axis will be obtained from variable yvar, and the default title for the x axis will be obtained from xvar. Sometimes the plottype substitutes a different title; for instance,

. twoway lfit yvar xvar

labels the y axis "Fitted values" regardless of the name or variable label associated with variable yvar.

If multiple variables are associated with the same axis, the axis titles are dispensed with and instead a legend is shown to label each plot. For instance, in

. twoway scatter y1var xvar || line y2var xvar || lfit y1var xvar

a legend with a separate key and label is shown for y1var_title, y2var_title, and Fitted values.

Overriding default titles

You may specify the title to appear on the y axis using ytitle() and the title to appear on the x axis using xtitle(). You specify the text -- surrounded by double quotes -- inside the option:

ytitle("My y title")

xtitle("My x title")

For scatter, the command might read

. scatter yvar xvar, ytitle("Price") xtitle("Quantity")

Specifying multiline titles

Titles may include more than one line. Lines are specified one after the other, each enclosed in double quotes:

ytitle("First line" "Second line")

xtitle("First line" "Second line" "Third line")

Suppressing axis titles

To eliminate an axis title, specify {y|x}title("").

To eliminate the title on a second, third, ..., axis, specify {y|x}title("", axis(#)). See Titles with multiple y axes or multiple x axes below.

Interpretation of repeated options

xtitle() and ytitle() may be specified more than once in the same command. When you do that, the rightmost one takes effect.

See Interpretation of repeated options in [G-3] axis_label_options. Multiple ytitle() and xtitle() options work the same way. The twist for the title options is that you specify whether the extra information is to be prefixed or suffixed onto what came before.

For instance, pretend that sts graph produced the x axis title "analysis time". If you typed

. sts graph, xtitle("My new title")

the title you specified would replace that. If you typed

.sts graph, xtitle("in days", suffix)

the x axis title would be (first line) "analysis time" (second line) "in days". If you typed

.sts graph, xtitle("Time to failure", prefix)

the x axis title would be (first line) "Time to failure" (second line) "analysis time".

Titles with multiple y axes or multiple x axes

When you have more than one y or x axis (see [G-3] axis_choice_options), remember to specify the axis(#) suboption to indicate to which axis you are referring.

Contour axes -- ztitle()

The ztitle() option is unusual in that it applies not to axes on the plot region, but to the axis that shows the scale of a contour legend. It has effect only when the graph includes a twoway contour plot; see [G-2] graph twoway contour. In all other respects, it acts like xtitle(), ytitle(), and ttitle().


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