twoway parea
twoway parea is a modification of standard Stata twoway area command. It uses some undocumented features of Stata to enable pattern fills (tested on Windows only).
Syntax
twoway area yvar xvar [if] [in] [, options]
options description --------------------------------------------------------------------- pattern(pattern_name) fill pattern; default is pattern10 (solid) vertical vertical area plot; the default horizontal horizontal area plot base(#) value to drop to; default is 0 nodropbase programmer's option sort sort by xvar; recommended
INCLUDE help gr_areaopt
INCLUDE help gr_axlnk
INCLUDE help gr_twopt --------------------------------------------------------------------- Option base() is rightmost; vertical, horizontal, nodropbase, and sort are unique; see repeated options.
Description
This command is a modified version of the standard twoway area command with the pattern fills enabled. All other options of twoway area should be supported as well.
Options pattern(pattern_name) specifies which pattern must be used for fills. Possible values are: pattern1, pattern2,..., pattern10, background, and none. Value pattern10 is the default value and corresponds to a solid fill. If separate areas must have different fills, combine several calls to parea with "||" symbol.
Examples
. do pareademo
. sysuse sp500 . twoway parea high date, pattern(pattern8) || parea low date, pattern(pattern > 6) scale(0.5)
. sysuse auto . twoway parea l w, sort pattern(pattern6)
. twoway parea d w, sort pattern(pattern9) || parea l w if w<=3600, sort patte > rn(pattern6) || parea l w if w>=3600, sort pattern(pattern4) ,legend(rows(1))
Author
Sergiy Radyakin, sradyakin(at)worldbank.org
Versions
Aug. 2007 First version for Stata 9 Apr. 2008 Corrected for some undocumented internal changes in Stata 10 > (which prevented the legend keys to be rendered).
Also see
Manual: [G] graph twoway area
Online: twoway area