help wallplot

Stacked plot of one or more variables with depth as vertical axis

Syntax

wallplot depthvar xvarlist
[if] [in]
[,
varallopts(graph_options)
var1opts(graph_options)
var2opts(graph_options)
var3opts(graph_options)
...
var20opts(graph_options)
graph_options
]

Description

wallplot is intended primarily for researchers with environmental
data to be plotted with depth below surface as vertical axis. The depth
variable depthvar must always be specified first and by default
will be shown with a reversed scale, low values at the top and high
values at the bottom. Other numeric variables should be specified
afterwards and will be plotted as stacked areas or bars against the x axis.
Each distinct depth value should occur just once in the data provided.

The name wallplot is a little fanciful. Not every distinct kind of
graph has a specific dedicated name, which is on balance a good thing,
but every program needs a specific name, ideally not too lengthy nor too
cryptic. In this case you are asked to imagine that you are looking at a
wall, tiled or bricked in some pattern.

Remarks

The tacit assumption is that the variable(s) shown are parts of a whole
with zero or positive values, and hence or otherwise may meaningfully
be stacked or cumulated to show a total for each depth as well as
individual components. There is no assumption that values add to a
constant; any such scaling should be produced in advance when desired.

Each other variable is by default shown as a area plot added
horizontally to all previously mentioned variables. The first other variable
is by default shown using twoway area and subsequently mentioned
variables are by default shown using twoway rarea, stacking or
cumulation being ensured by calculation.

Use recast() to recast to equivalent twoway graphs, most
obviously recast(rbar). (The equivalent recast from
twoway area to twoway bar is handled automatically.)

Note that variable labels will be echoed to the graph when they exist,
but typically they should be very concise as well as informative.
Units of measurement common to several variables are better
specified by a note() or caption() or subtitle()
option.

If the vertical scale is in effect a height scale, then specify
ysc(noreverse) to override the default.

Options

varallopts() specify any options to be applied repeatedly to the
plot elements for all individual variables.

var1opts(),
var2opts(),
var3opts(),
...
var20opts()
specify any options to be applied repeatedly to the
plot elements for the 1st, 2nd, 3rd, ..., 20th variable plotted against
the x axis. The limit of 20 is plucked out of the air as presumably
being large enough for foreseeable needs. Users needing more should edit
the code and then take full responsibility for that edit. Any such
option always overrrides varallopts().

graph_options are any options allowed for twoway rarea or for
any equivalent graph command invoked using recast() that are
to be applied to the graph as a whole. The option horizontal is automatic.

Examples

. clear

. input levels freqcores freqblanks freqtools

25 21 32 70

24 36 52 115

23 126 650 549

22 159 2342 1633

21 75 487 511

20 176 1090 912

19 132 713 578

18 46 374 266

17 550 6182 1541

16 76 846 349

15 17 182 51

14 4 51 14

13 29 228 130

12 135 2227 729

end

. gen total = freqc + freqb + freqt

. foreach t in cores blanks tools {

. gen p`t' = freq`t' / total

. label var p`t' "`t'"

. }

.

. wallplot levels p*, ysc(noreverse) yla(12/25)

. more

. wallplot levels p*, ysc(noreverse) yla(12/25) ///

var1opts(fcolor(red*0.5) lcolor(red*0.8)) ///

var2opts(fcolor(magenta*0.5) lcolor(magenta*0.8)) ///

var3opts(fcolor(blue*0.5) lcolor(blue*0.8))

. more

. wallplot levels p*, ysc(noreverse) yla(12/25) ///

var1opts(fcolor(red*0.5) lcolor(red*0.8)) ///

var2opts(fcolor(magenta*0.5) lcolor(magenta*0.8)) ///

var3opts(fcolor(blue*0.5) lcolor(blue*0.8)) ///

recast(rbar) legend(cols(3)) aspect(1) plotregion(margin(zero))

Author

Nicholas J. Cox, Durham University

n.j.cox@durham.ac.uk

Acknowledgments

This command was stimulated by discussions with Jeff Warburton.
The data used in the examples are from Doran and Hodson (1975, p.259).

Reference

Doran, J.E. and Hodson, F.R. 1975.
Mathematics and computers in archaeology.
Edinburgh: Edinburgh University Press.

Also see

Manual:
[G-2] graph twoway rarea,
[G-2] graph twoway rbar,
[G-2] graph bar,
[G-3] advanced_options

User-written:
depthplot (if installed),
tabplot (if installed)