Stata 15 help for markerlabelstyle

[G-4] markerlabelstyle -- Choices for overall look of marker labels


markerlabelstyle Description ------------------------------------------------------------------------- p1 - p15 used by first to fifteenth plot p1box - p15box used by first to fifteenth "box" plot -------------------------------------------------------------------------

Other markerlabelstyles may be available; type

. graph query markerlabelstyle

to obtain the complete list of markerlabelstyles installed on your computer.


markerlabelstyle defines the position, gap, angle, size, and color of the marker label. See [G-3] marker_label_options for more information.

markerlabelstyle is specified in the mlabstyle() option,

. graph ..., mlabstyle(markerlabelstyle) ...

Sometimes (for example, with twoway scatter), a markerlabelstylelist is allowed: a markerlabelstylelist is a sequence of markerlabelstyles separated by spaces. Shorthands are allowed to make specifying the list easier; see [G-4] stylelists.


Remarks are presented under the following headings:

What is a markerlabel? What is a markerlabelstyle? You do not need to specify a markerlabelstyle Specifying a markerlabelstyle can be convenient What are numbered styles?

What is a markerlabel?

A marker label is identifying text that appears next to (or in place of) a marker. Markers are the ink used to mark where points are on a plot.

What is a markerlabelstyle?

The look of marker labels is defined by four attributes:

1. the marker label's position -- where the marker is located relative to the point; see [G-4] clockposstyle

2. the gap between the marker label and the point; see [G-4] clockposstyle

3. the angle at which the identifying text is presented; see [G-4] anglestyle

4. the overall style of the text; see [G-4] textstyle

a. the size of the text; see [G-4] textsizestyle

b. the color and opacity of the text; see [G-4] colorstyle

The markerlabelstyle specifies all four of these attributes.

You do not need to specify a markerlabelstyle

The markerlabelstyle is specified by the option


Correspondingly, you will find other options available:

mlabposition(clockposstyle) mlabgap(relativesize) mlabangle(anglestyle) mlabtextstyle(textstyle) mlabsize(textstyle) mlabcolor(colorstyle)

You specify the markerlabelstyle when a style exists that is exactly what you want or when another style would allow you to specify fewer changes to obtain what you want.

Specifying a markerlabelstyle can be convenient

Consider the command

. scatter y1 y2 x, mlabel(country country)

Assume that you want the marker labels for y2 versus x to appear the same as for y1 versus x. (An example of this can be found under Eliminating overprinting and overruns and under Advanced use in [G-3] marker_label_options.) You might set all the attributes for the marker labels for y1 versus x and then set all the attributes for y2 versus x to be the same. It would be easier, however, to type

. scatter y1 y2 x, mlabel(country country) mlabstyle(p1 p1)

When you do not specify mlabstyle(), results are the same as if you specified

mlabstyle(p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15)

where the extra elements are ignored. In any case, p1 is one set of marker-label attributes, p2 is another set, and so on.

Say that you wanted y2 versus x to look like y1 versus x, except that you wanted the line to be green; you could type

. scatter y1 y2 x, mlabel(country country) mlabstyle(p1 p1) mlabcolor(. green)

There is nothing special about markerlabelstyles p1, p2, ...; they merely specify sets of marker-label attributes, just like any other named markerlabelstyle. Type

. graph query markerlabelstyle

to find out what other marker-label styles are available.

Also see Appendix: Styles and composite styles in [G-2] graph twoway scatter for more information.

What are numbered styles?

p1 - p15 are the default styles for marker labels in twoway graphs that support marker labels, for example, twoway scatter, twoway dropline, and twoway connected. p1 is used for the first plot, p2 for the second, and so on.

p1box - p15box are the default styles used for markers showing the outside values on box charts. p1box is used for the outside values on the first set of boxes, p2box for the second set, and so on.

The "look" defined by a numbered style, such as p1 or p3box -- by look we include such things as text color, text size, and position around marker -- is determined by the scheme (see [G-4] schemes intro) selected.

Numbered styles provide default looks that can be controlled by a scheme. They can also be useful when you wish to make, say, the second set of labels on a graph look like the first. See Specifying a markerlabelstyle can be convenient above for an example.

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