Stata 15 help for twoway_scatteri

[G-2] graph twoway scatteri -- Scatter with immediate arguments

Syntax

twoway scatteri immediate_values [, options]

where immediate_values is one or more of

#_y #_x [(#_clockposstyle)] ["text for label"]

See [G-4] clockposstyle for a description of #_clockposstyle.

Menu

Graphics > Twoway graph (scatter, line, etc.)

Description

scatteri is an immediate version of twoway scatter; see [U] 19 Immediate commands and immed. scatteri is intended for programmer use but can be useful interactively.

Options

options are as defined in [G-2] graph twoway scatter, with the following modifications:

If "text for label" is specified among any of the immediate arguments, option mlabel() is assumed.

If (#_clockposstyle) is specified among any of the immediate arguments, option mlabvposition() is assumed.

Remarks

Immediate commands are commands that obtain data from numbers typed as arguments. Typing

. twoway scatteri 1 1 2 2, any_options

produces the same graph as typing

. clear

. input y x y x 1. 1 1 2. 2 2 3. end . twoway scatter y x, any_options

twoway scatteri does not modify the data in memory.

scatteri is intended for programmer use but can be used interactively. In [G-3] added_text_option, we demonstrated the use of option text() to add text to a graph:

. twoway qfitci mpg weight, stdf || scatter mpg weight, ms(O) text(41 2040 "VW Diesel", place(e)) text(28 3260 "Plymouth Arrow", place(e)) text(35 2050 "Datsun 210 and Subaru", place(e)) (click to run)

Below we use scatteri to obtain similar results:

. twoway qfitci mpg weight, stdf || scatter mpg weight, ms(O) || scatteri 41 2040 (3) "VW Diesel" 28 3260 (3) "Plymouth Arrow" 35 2050 (3) "Datsun 210 and Subaru" , msymbol(i) (click to run)

We translated text(..., place(e)) to (3), 3 o'clock being the clockposstyle notation for the east compassdirstyle. Because labels are by default positioned at 3 o'clock, we could omit (3) altogether:

. twoway qfitci mpg weight, stdf || scatter mpg weight, ms(O) || scatteri 41 2040 "VW Diesel" 28 3260 "Plymouth Arrow" 35 2050 "Datsun 210 and Subaru" , msymbol(i)

We specified msymbol(i) option to suppress displaying the marker symbol.

Technical note: Programmers: Note carefully scatter's advanced_option recast(); see [G-3] advanced_options. It can be used to good effect, such as using scatteri to add areas, bars, spikes, and dropped lines.


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