help symbolstyle
-------------------------------------------------------------------------------
Title
[G] symbolstyle -- Choices for the shape of markers
Syntax
synonym
symbolstyle (if any) description
-------------------------------------------------------
circle O solid
diamond D solid
triangle T solid
square S solid
plus +
x X
smcircle o solid
smdiamond d solid
smsquare s solid
smtriangle t solid
smplus smx x
circle_hollow Oh hollow
diamond_hollow Dh hollow
triangle_hollow Th hollow
square_hollow Sh hollow
smcircle_hollow oh hollow
smdiamond_hollow dh hollow
smtriangle_hollow th hollow
smsquare_hollow sh hollow
point p a small dot
none i a symbol that is invisible
-------------------------------------------------------
For a symbol palette displaying each of the above symbols, type
. palette symbolpalette [, scheme(schemename)]
Other symbolstyles may be available; type
. graph query symbolstyle
to obtain the complete list of symbolstyles installed on your
computer.
Description
Markers are the ink used to mark where points are on a plot; see [G]
marker_options. symbolstyle specifies the shape of the marker.
You specify the symbolstyle inside the msymbol() option allowed with many
of the graph commands:
. graph twoway ..., msymbol(symbolstyle) ...
Sometimes you will see that a symbolstylelist is allowed:
. scatter ..., msymbol(symbolstylelist) ...
A symbolstylelist is a sequence of symbolstyles separated by spaces.
Shorthands are allowed to make specifying the list easier; see [G]
stylelists.
Remarks
Remarks are presented under the following headings:
Typical use
Filled and hollow symbols
Size of symbols
Typical use
msymbol(symbolstyle) is one of the more commonly specified options. For
instance, you may not be satisfied with the default rendition of
. scatter mpg weight if foreign ||
scatter mpg weight if !foreign
and prefer
. scatter mpg weight if foreign, msymbol(oh) ||
scatter mpg weight if !foreign, msymbol(x)
When you are graphing multiple y variables in the same plot, you can
specify a list of symbolstyles inside the msymbol() option:
. scatter mpg1 mpg2 weight, msymbol(oh x)
The result is the same as typing
. scatter mpg1 weight, msymbol(oh) ||
scatter mpg2 weight, msymbol(x)
Also, in the above, we specified the symbol-style synonyms. Whether you
type
. scatter mpg1 weight, msymbol(oh) ||
scatter mpg2 weight, msymbol(x)
or
. scatter mpg1 weight, msymbol(smcircle_hollow) ||
scatter mpg2 weight, msymbol(smx)
makes no difference.
Filled and hollow symbols
The symbolstyle specifies the shape of the symbol, and in that sense, one
of the styles circle and hcircle -- and diamond and hdiamond, etc. -- is
unnecessary in that each is a different rendition of the same shape. The
option mfcolor(colorstyle) (see [G] marker_options) specifies how the
inside of the symbol is to be filled. hcircle(), hdiamond, etc., are
included for convenience and are equivalent to specifying
msymbol(Oh): msymbol(O) mfcolor(none)
msymbol(dh): msymbol(d) mfcolor(none)
etc.
Using mfcolor() to fill the inside of a symbol with different colors
sometimes creates what are effectively new symbols. For instance, if you
take msymbol(O) and fill its interior with a lighter shade of the same
color used to outline the shape, you obtain a pleasing result. For
instance, you might try
msymbol(O) mlcolor(yellow) mfcolor(.5*yellow)
or
msymbol(O) mlcolor(gs5) mfcolor(gs12)
as in
. scatter mpg weight, msymbol(O) mlcolor(gs5) mfcolor(gs14)
(click to run)
Size of symbols
Just as msymbol(O) and msymbol(Oh) differ only in mfcolor(), msymbol(O)
and msymbol(o) -- symbols circle and smcircle -- differ only in msize().
In particular,
msymbol(O): msymbol(O) msize(medium)
msymbol(o): msymbol(O) msize(small)
and the same is true for all the other large and small symbol pairs.
msize() is interpreted as being relative to the size of the graph region
(see [G] region_options), so the same symbol size will in fact be a
little different in
. scatter mpg weight
and
. scatter mpg weight, by(foreign total)
Also see
Manual: [G] symbolstyle
Help: [G] marker_options; [G] markersizestyle, [G] colorstyle, [G]
linepatternstyle, [G] linewidthstyle, [G] linestyle, [G]
markerstyle