Stata 15 help for markerstyle

[G-4] markerstyle -- Choices for overall look of markers

Syntax

markerstyle Description ------------------------------------------------------------------------- p1 - p15 used by first to fifteenth "scatter" plot p1box - p15box used by first to fifteenth "box" plot p1dot - p15dot used by first to fifteenth "dot" plot -------------------------------------------------------------------------

Other markerstyles may be available; type

. graph query markerstyle

to obtain the full list installed on your computer.

Description

Markers are the ink used to mark where points are on a plot. markerstyle defines the symbol, size, and color of a marker. See [G-3] marker_options for more information.

markerstyle is specified in the mstyle() option,

. graph ..., mstyle(markerstyle) ...

Sometimes you will see that a markerstylelist is allowed:

. twoway scatter ..., mstyle(markerstylelist) ...

A markerstylelist is a sequence of markerstyles separated by spaces. Shorthands are allowed to make specifying the list easier; see [G-4] stylelists.

Remarks

Remarks are presented under the following headings:

What is a marker? What is a markerstyle? You do not have to specify a markerstyle Specifying a markerstyle can be convenient What are numbered styles?

What is a marker?

Markers are the ink used to mark where points are on a plot. Some people use the word point or symbol, but a point is where the marker is placed, and a symbol is merely one characteristic of a marker.

What is a markerstyle?

Markers are defined by five attributes:

1. symbol -- the shape of the marker; see [G-4] symbolstyle

2. markersize -- the size of the marker; see [G-4] markersizestyle

3. overall color and opacity of the marker; see [G-4] colorstyle

4. interior (fill) color and opacity of the marker; see [G-4] colorstyle

5. the line that outlines the shape of the marker:

a. the overall style of the line; see [G-4] linestyle

b. the thickness of the line; see [G-4] linewidthstyle

c. the color and opacity of the line; see [G-4] colorstyle

d. the alignment of the border or outline; see [G-4] linealignmentstyle

The markerstyle defines all five (seven) of these attributes.

You do not have to specify a markerstyle

The markerstyle is specified via the

mstyle(markerstyle)

option. Correspondingly, you will find eight other options available:

msymbol(symbolstyle) msize(markersizestyle) mcolor(colorstyle) mfcolor(colorstyle) mlstyle(linestyle) mlwidth(linewidthstyle) mlcolor(colorstyle) mlalign(linealignmentstyle)

You specify the markerstyle 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 markerstyle can be convenient

Consider the command

. scatter y1var y2var xvar

Say that you wanted the markers for y2var versus xvar to be the same as y1var versus xvar. You might set all the characteristics of the marker for y1var versus xvar and then set all the characteristics of the marker for y2var versus xvar to be the same. It would be easier, however, to type

. scatter y1var y2var xvar, mstyle(p1 p1)

mstyle() is the option that specifies the overall style of the marker. When you do not specify the mstyle() option, results are the same as if you specified

mstyle(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 characteristics, p2 another, and so on.

Say that you wanted y2var versus xvar to look like y1var versus xvar, except that you wanted the symbols to be green; you could type

. scatter y1var y2var xvar, mstyle(p1 p1) mcolor(. green)

There is nothing special about the markerstyles p1, p2, ...; they merely specify sets of marker attributes just like any other named markerstyle. Type

. graph query markerstyle

to find out what other marker styles are available. You may find something pleasing, and if so, that is more easily specified than each of the individual options to modify the shape, color, size, ... elements.

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 p3dot -- and by "look" we include such things as color, size, or symbol -- is determined by the scheme 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 markers on a graph look like the first. See Specifying a markerstyle can be convenient above for an example.


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