📄 scatter.hlp
字号:
{smcl}
{* 08apr2005}{...}
{cmd:help scatter} {right:dialogs: {dialog escatter:easy scatter plot}}
{right:{dialog twoway_overlay:overlaid twoway}{space 2}}
{right:{dialog twoway_simple:single twoway}{space 4}}
{hline}
{* index scatter tt}{...}
{* index twoway scatter tt}{...}
{* index pstyle() tt option}{...}
{* index jitter() tt option}{...}
{* index jitterseed() tt option}{...}
{title:Title}
{p2colset 5 33 35 2}{...}
{p2col :{hi:[G] graph twoway scatter} {hline 2}}Twoway scatterplots{p_end}
{p2colreset}{...}
{title:Syntax}
{p 8 34 2}
[{cmdab:tw:oway}]
{cmdab:sc:atter}
{it:varlist}
{ifin}
{weight}
[{cmd:,} {it:options}]
{pstd}
where {it:varlist} is
{p_end}
{it:y_1} [{it:y_2} [...]] {it:x}
{it:options}{col 35}description
{hline 70}
{it:{help scatter##marker_options:marker_options}}{...}
{col 35}change look of markers (color, size, etc.)
{it:{help scatter##marker_label_options:marker_label_options}}{...}
{col 35}add marker labels; change look or position
{it:{help scatter##connect_options:connect_options}}{...}
{col 35}change look of lines or connecting method
{it:{help scatter##composite_style_option:composite_style_option}}{...}
{col 35}overall style of the plot
{it:{help scatter##jitter_options:jitter_options}}{...}
{col 35}jitter marker positions using random noise
{it:{help scatter##axis_choice_options:axis_choice_options}}{...}
{col 35}associate plot with alternate axis
{it:{help scatter##twoway_options:twoway_options}}{...}
{col 35}{help title options:titles}, {help legend option:legends}, {help axis options:axes}, added {help added line options:lines} and {help added text options:text},
{col 35}{help by option:by}, {help region options:regions}, {help name option:name}, {help aspect option:aspect ratio}, {help twoway options:etc.}
{hline 70}
{marker marker_options}
{it:marker_options}{col 42}description
{hline 70}
{cmdab:m:symbol:(}{it:{help symbolstyle}list}{cmd:)}{col 42}{...}
shape of marker
{cmdab:mc:olor:(}{it:{help colorstyle}list}{cmd:)}{col 42}{...}
color of marker, inside and out
{cmdab:msiz:e:(}{it:{help markersizestyle}list}{cmd:)}{col 42}{...}
size of marker
{cmdab:mfc:olor:(}{it:{help colorstyle}list}{cmd:)}{col 42}{...}
inside or "fill" color
{cmdab:mlc:olor:(}{it:{help colorstyle}list}{cmd:)}{col 42}{...}
color of outline
{cmdab:mlw:idth:(}{it:{help linewidthstyle}list}{cmd:)}{col 42}{...}
thickness of outline
{cmdab:mlsty:le:(}{it:{help linestyle}list}{cmd:)}{col 42}{...}
overall style of outline
{cmdab:msty:le:(}{it:{help markerstyle}list}{cmd:)}{col 42}{...}
overall style of marker
{hline 70}
See {it:{help marker_options}}.
{marker marker_label_options}
{it:marker_label_options}{col 42}description
{hline 70}
{cmd:mlabel(}{it:varlist}{cmd:)}{...}
{col 42}specify marker variables
{cmdab:mlabp:osition:(}{it:{help clockposstyle:clockpos}list}{cmd:)}{...}
{col 42}where to locate label
{cmdab:mlabv:position:(}{it:varname}{cmd:)}{...}
{col 42}where to locate label 2
{cmdab:mlabg:ap:(}{it:{help relativesize}list}{cmd:)}{...}
{col 42}gap between marker and label
{cmdab:mlabang:le:(}{it:{help anglestyle}list}{cmd:)}{...}
{col 42}angle of label
{cmdab:mlabs:ize:(}{it:{help textsizestyle}list}{cmd:)}{...}
{col 42}size of label
{cmdab:mlabc:olor:(}{it:{help colorstyle}list}{cmd:)}{...}
{col 42}color of label
{cmdab:mlabt:extstyle:(}{it:{help textstyle}list}{cmd:)}{...}
{col 42}overall style of text
{cmdab:mlabsty:le:(}{it:{help markerlabelstyle}list}{cmd:)}{...}
{col 42}overall style of label
{hline 70}
See {it:{help marker_label_options}}.
{marker connect_options}
{it:connect_options}{col 42}description
{hline 70}
{cmdab:c:onnect:(}{it:{help connectstyle}list}{cmd:)}{...}
{col 42}how to connect points
{cmd:sort}[{cmd:(}{it:varlist}{cmd:)}]{...}
{col 42}how to order data before connecting
{cmdab:cmis:sing:(}{c -(}{cmd:y}|{cmd:n}{c )-} ...{cmd:)}{...}
{col 42}missing values are ignored
{cmdab:l:pattern:(}{it:{help linepatternstyle}list}{cmd:)}{...}
{col 42}line pattern (solid, dashed, etc.)
{cmdab:lw:idth:(}{it:{help linewidthstyle}list}{cmd:)}{...}
{col 42}thickness of line
{cmdab:lc:olor:(}{it:{help colorstyle}list}{cmd:)}{...}
{col 42}color of line
{cmdab:lsty:le:(}{it:{help linestyle}list}{cmd:)}{...}
{col 42}overall style of line
{hline 70}
See {it:{help connect_options}}.
{marker composite_style_option}
{it:composite_style_option}{col 42}description
{hline 70}
{cmdab:psty:le:(}{it:{help pstyle}list}{cmd:)}{...}
{col 42}all the {cmd:...style()} options above
{hline 70}
{pin}
See {help scatter##remarks19:Styles and composite styles} under {hi:Remarks} below.
{marker jitter_options}
{it:jitter_options}{col 42}description
{hline 70}
{cmd:jitter(}{it:{help relativesize}list}{cmd:)}{col 42}{...}
perturb location of point
{cmd:jitterseed(}{it:#}{cmd:)}{col 42}{...}
random number seed for {cmd:jitter()}
{hline 70}
{pin}
See {help scatter##jitter:Jittered markers} under {hi:Remarks} below.
{marker axis_choice_options}
{it:axis_choice_options}{col 42}description
{hline 70}
{cmdab:yax:is:(}{it:#} [{it:#} ...]{cmd:)}{...}
{col 42}which {it:y} axis to use
{cmdab:xax:is:(}{it:#} [{it:#} ...]{cmd:)}{...}
{col 42}which {it:x} axis to use
{hline 70}
See {it:{help axis_choice_options}}.
{marker twoway_options}
{it:twoway_options}{col 42}description
{hline 70}
{it:{help added_line_options}}{...}
{col 42}draw lines at specified {it:y} or {it:x} values
{it:{help added_text_option}}{...}
{col 42}display text at specified ({it:y},{it:x}) value
{it:{help axis_options}}{...}
{col 42}labels, ticks, grids, log scales
{it:{help title_options}}{...}
{col 42}titles, subtitles, notes, captions
{it:{help legend_option}}{...}
{col 42}legend explaining what means what
{help scale_option:{bf:scale(}{it:#}{bf:)}}{...}
{col 42}resize text and markers
{it:{help region_options}}{...}
{col 42}outlining, shading, aspect ratio
{it:{help aspect_option}}{...}
{col 42}constrain aspect ratio of plot region
{help scheme_option:{bf:scheme(}{it:schemename}{cmd:)}}{...}
{col 42}overall look
{help by_option:{bf:by(}{it:varlist}{bf:, ...)}}{...}
{col 42}repeat for subgroups
{help nodraw_option:{bf:nodraw}}{...}
{col 42}suppress display of graph
{help name_option:{bf:name(}{it:name}{bf:, ...)}}{...}
{col 42}specify name for graph
{help saving_option:{bf:saving(}{it:filename}{bf:, ...)}}{...}
{col 42}save graph in file
{it:{help advanced_options}}{...}
{col 42}difficult to explain
{hline 70}
See {it:{help twoway_options}}.
{phang}
{cmd:aweight}s,
{cmd:fweight}s, and
{cmd:pweight}s are allowed; see {help weight}.
{title:Description}
{pstd}
{cmd:scatter} draws scatterplots and is the mother of all the {cmd:twoway}
plottypes, such as {cmd:line}, {cmd:lfit}, etc.
{pstd}
{cmd:scatter} is both a command and it is a {it:plottype} as
defined in {helpb twoway}. Thus the syntax for {cmd:scatter} is
{cmd:. graph twoway scatter} ...
{cmd:. twoway scatter} ...
{cmd:. scatter} ...
{pstd}
Being a plottype, {cmd:scatter} may be combined with other plottypes in the
{cmd:twoway} family, as in,
{phang2}
{cmd:. twoway (scatter} ...{cmd:) (line} ...{cmd:) (lfit} ...{cmd:)} ...
{pstd}
which can equivalently be written
{phang2}
{cmd:. scatter} ... {cmd:|| line} ... {cmd:|| lfit} ... {cmd:||} ...
{title:Options}
{phang}
{it:marker_options}
specify how the points on the graph are to be designated.
Markers are the ink used to mark where points are on a plot.
Markers have shape, color, and size, and other characteristics.
See {it:{help marker_options}} for a description of markers
and the options that specify them.
{pmore}
{cmd:msymbol(O D S T + X o d s t smplus x)} is the default.
{cmd:msymbol(i)} will suppress the appearance of the marker altogether.
{phang}
{it:marker_label_options}
specify labels to appear next to or in place of the markers. For
instance, if you were plotting country data, marker labels would allow you
to have "Argentina", "Bolivia", ..., appear next to each point and, with a
small amount of data, that might be desirable.
See {it:{help marker_label_options}} for a description of marker
labels and the options that control them.
{pmore}
By default, no marker labels are displayed.
If you wish to display marker labels in place of the markers, specify
{cmd:mlabposition(0)} and {cmd:msymbol(i)}.
{phang}
{it:connect_options}
specify how the points are to be connected.
The default is not to connect the points.
{pmore}
{cmd:connect()} specifies whether points are to be connected and, if so,
how the line connecting them is to be shaped. The line between each pair
of points can connect them directly or in stairstep fashion.
{pmore}
{cmd:sort} specifies that the data be sorted by the {it:x}
variable before the points are connected. Unless you are after a special
effect or your data are already sorted, do not forget to specify this
option. If you are after a special effect, and if the data are not
already sorted, you can specify {cmd:sort(}{it:varlist}{cmd:)} to specify
exactly how the data should be sorted. Understand that specifying
{cmd:sort} or {cmd:sort(}{it:varlist}{cmd:)} when it is not necessary
will slow Stata down a little.
You must specify {cmd:sort} if you wish to connect points and
you specify the {it:twoway_option}
{cmd:by()} with {cmd:total}.
{pmore}
{cmd:cmissing(y)} and {cmd:cmissing(n)} specify whether missing
values are ignored when points are connected; whether the line should have
a break in it. The default is {cmd:cmissing(y)}, meaning that there will
be no breaks.
{pmore}
{cmd:lpattern()} specifies how the style of the line is to be drawn:
solid, dashed, etc.
{pmore}
{cmd:lwidth()} specifies the width of the line.
{pmore}
{cmd:lcolor()} specifies the color of the line.
{pmore}
{cmd:lstyle()} specifies the overall style of the line.
{pmore}
See {it:{help connect_options}} for more information on these
and related options.
See {help lines} for an overview of lines.
{phang}
{cmd:pstyle(}{it:pstyle}{cmd:)}
specifies the overall style of the plot and is a composite of
{cmd:mstyle()}, {cmd:mlabstyle()}, {cmd:lstyle()}, {cmd:connect()}, and
{cmd:cmissing()}. The default is {cmd:pstyle(p1)} for the first plot,
{cmd:pstyle(p2)} for the second, and so on. See
{help scatter##remarks19:Styles and composite styles}
under {hi:Remarks} below.
{phang}
{cmd:jitter(}{it:relativesize}{cmd:)}
adds spherical random noise to the data before plotting. This is useful
when plotting data which otherwise would result in points plotted on
top of each other. See {help scatter##jitter:Jittered markers} under
{hi:Remarks} below.
{pmore}
Commonly specified are {cmd:jitter(5)} or {cmd:jitter(6)};
{cmd:jitter(0)} is the default. See {it:{help relativesize}}
for a description of relative sizes.
{phang}
{cmd:jitterseed(}{it:#}{cmd:)}
specifies the seed for the random noise added by the {cmd:jitter()}
option. {it:#} should be specified as a positive integer. Use this
option to reproduce the same plotted points when the
{cmd:jitter()} option is specified.
{phang}
{it:axis_choice_options}
are for use when you have multiple {it:x} or {it:y} axes.
See {it:{help axis_choice_options}} for more information.
{phang}
{it:twoway_options} include
{pmore}
{it:added_line_options},
which specify that horizontal or vertical lines be drawn on the
graph; see {it:{help added_line_options}}. If your interest is
in drawing grid lines through the plot region, see
{it:axis_options} below.
{pmore}
{it:added_text_option},
which specify text to be displayed on the graph (inside the plot
region); see {it:{help added_text_option}}.
{pmore}
{it:axis_options},
which allow you to specify labels, ticks, and grids. These options
also allow you to obtain logarithmic scales; see
{it:{help axis_options}}.
{pmore}
{it:title_options},
allow you to specify titles, subtitles, notes, and captions
to be placed on the graph; see {it:{help title_options}}.
{pmore}
{it:legend_option},
which allows specifying the legend explaining the symbols and line
styles used; see {it:{help legend_option}}.
{pmore}
{cmd:scale(}{it:#}{cmd:)},
which makes all the text and markers on a graph larger or smaller
({cmd:scale(1)} means no change); see {it:{help scale_option}}.
{pmore}
{it:region_options},
which allow you to control the aspect ratio and to specify that the
graph be outlined, or given a background shading; see
{it:{help region_options}}.
{pmore}
{cmd:scheme(}{it:schemename}{cmd:)},
which specifies the overall look of the graph; see
{it:{help scheme_option}}.
{pmore}
{cmd:by(}{it:varlist}{cmd:,} ...{cmd:)},
which allows drawing multiple graphs for each subgroup of the data;
see {it:{help by_option}}.
{pmore}
{cmd:nodraw},
which prevents the graph from being displayed; see
{it:{help nodraw_option}}.
{pmore}
{cmd:name(}{it:name}{cmd:)},
which allows you to save the graph in memory under a name
different from {cmd:Graph}; see
{it:{help name_option}}.
{pmore}
{cmd:saving(}{it:filename}[{cmd:, asis replace}]{cmd:)},
which allows you to save the graph to disk; see
{it:{help saving_option}}.
{pmore}
other options that allow you to suppress the display of the graph, to name
the graph, etc.
{pmore}
See {it:{help twoway_options}}.
{title:Remarks}
{pstd}
Remarks are presented under the headings
{help scatter##remarks1:Typical use}
{help scatter##remarks2:Scatter syntax}
{help scatter##remarks3:The overall look for the graph}
{help scatter##remarks4:The size and aspect ratio of the graph}
{help scatter##remarks5:Titles}
{help scatter##remarks6:Axis titles}
{help scatter##remarks7:Axis labels and ticking}
{help scatter##remarks8:Grid lines}
{help scatter##remarks9:Added lines}
{help scatter##remarks10:Axis range}
{help scatter##remarks11:Log scales}
{help scatter##remarks12:Multiple axes}
{help scatter##remarks13:Markers}
{help scatter##remarks14:Weighted markers}
{help scatter##remarks15:Jittered markers}
{help scatter##remarks16:Connected lines}
{help scatter##remarks17:Graphs by groups}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -