help depthplot

Plot of one or more variables with depth as vertical axis

Syntax

depthplot depthvar xvarlist
[if] [in]
[,
by(by_options)
graph_options
]

Description

depthplot 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 in separate panels with separate x axes.
Each distinct depth value should occur just once in the data provided.

Remarks

Each other variable is by default shown as a line plot in a separate
panel. The panels are controlled with options of by(). For
example, by(row(1)) insists on one row of panels, which will often
be desired. by(xrescale) uses different scales to more nearly fill
the space available.

Use recast() to recast to equivalent twoway graphs, most
obviously recast(connected).
Other possibilities are
recast(area),
recast(bar) (avoid unless data are equally spaced),
recast(dot) (avoid any way),
recast(dropline),
recast(scatter) and
recast(spike). Watch out that other options may need to be set to
avoid puzzling or bizarre results, such as base(0) or
barwidth(). Start a search in the help at
advanced options. Look at the first block
of newplottypes.

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

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

Options

by() indicates options that control the panels collectively.

graph_options are any options allowed for line
excluding by().

Examples

. depthplot depth Au Cd As Pb Cu Zn

. depthplot depth Au Cd As Pb Cu Zn, by(row(1) compact xrescale note(all elements ppm)) recast(connected) yla(50(10)90, ang(h)) ytitle(depth (cm)) ms(Oh) lc(gs12)

. depthplot depth Au Cd As Pb Cu Zn, by(row(1) compact xrescale note(all elements ppm)) recast(scatter) yla(50(10)90, ang(h)) ytitle(depth (cm)) ms(Oh)

. depthplot depth Au Cd As Pb Cu Zn, by(row(1) compact xrescale note(all elements ppm)) recast(scatter) yla(50(10)90, ang(h)) ytitle(depth (cm)) ms(Oh) yli(50(2)96, lstyle(grid))

. depthplot depth Au Cd As Pb Cu Zn, by(row(1) compact xrescale note(all elements ppm)) recast(spike) yla(50(10)90, ang(h)) ytitle(depth (cm)) base(0)

. depthplot depth Au Cd As Pb Cu Zn, by(row(1) compact xrescale note(all elements ppm)) recast(dropline) yla(50(10)90, ang(h)) ytitle(depth (cm)) ms(Oh) base(0)

. depthplot depth Au Cd As Pb Cu Zn, by(row(1) compact xrescale note(all elements ppm)) recast(bar) yla(50(10)90, ang(h)) ytitle(depth (cm)) ms(Oh) base(0) barwidth(2)

. depthplot depth Au Cd As Pb Cu Zn, by(row(1) compact xrescale note(all elements ppm)) recast(area) yla(50(10)90, ang(h)) ytitle(depth (cm)) ms(Oh) base(0)

Author

Nicholas J. Cox, Durham University

n.j.cox@durham.ac.uk

Acknowledgments

This command was stimulated by discussions with Jeff Warburton.
The data in the example were discussed by Cox and Natasha L.M. Barlow (2008).

References

Cox, N.J. and Barlow, N.L.M.
2008.
Plotting on reversed scales.
Stata Journal 8: 295-298.
http://www.stata-journal.com/sjpdf.html?articlenum=gr0035

Also see

Manual: [G] graph twoway

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