help pvplot: Help for plotting paths with pvplot - 2009-10-11

Overview

The command pvplot creates a modified parallel coordinates graph with
data created with pvdata with selections made by pvsel. You can
use pvp as an abbreviation for pvplot.

Syntax

pvplot varlist
[, options]
*****************************************************************************
*SLR: cannot use a varlist with pvplot
*****************************************************************************

Interactive

quietly Do not show graph, only change options for next graph.

expadd Add a counter to the last name of the export
file which allows you to generate new graphs without having to change
the name of the export file when working interactively.

reset Build the plot from scratch by resetting all options
options rather than using prior options. When you do not turn off
interactive mode, options from the last graph are used unless you
specify them again. To remove an option that was set before, you
can drop it such as pvdata, hidecolor(drop).

Colors

colvar(varname) Colors vary by categories of this variable
By default, the colors are: red green blue cyan magenta yellow. Other
shortcuts for specifying colors are as follows.
colv(2cat) for red blue.
colv(3cat) for red blue green.
colv(4cat) for red blue green gold.
colv(5cat) for red blue green gold purple.
colv(bw) for __to be added__.

colors(colornames) Colors used by colvar.

colintensity(values) Intensities from 0 to 1 corresponding to colors.

colrange(min max) Minimuim and maximum values of colvar.
This is only needed if colvar has gaps.

intvar(intname) Intensity varies by categories of
this variable.

intensity(values) Intensities from 0 to 1
corresponding to categories of the variable specified by intvar.

intrange(min max) Minimuim and maximum values of intvar.
This is only needed if intvar has gaps.

Show and hide paths

showif(if-condition) Show lines if this condition holds;
otherwise lines are drawn with hidecolor.

hideif(if-condition) Hide lines if this condition
holds using hidecolor; otherwise lines are shown.

hidecolor(color) Color for hidden lines; use white to not show.

hideintensity(value) Intensity of hidden lines.

Grids, labels and borders

angle Put labels on an angle.

caption(text) Caption using standard Stata options.

title(text) Title using standard Stata options.

subtitle(text) Subtitle using standard Stata options.

note(text) Note using standard Stata options.

gridcolor(color) Color of grid lines.

gridwidth(#) Width of grid line; .3 is default.

gridywidth(#) Width of vertical grid line; .2 is default.

gridspace(#) Space from grid to paths as integer; default 10.

border Add shading around graph.

ylaboffset(#) Add offet to y-label; default is .25.

labelsize(string) Size of axes labels: tiny vsmall small medsmall
medium medlarge large vlarge.

aspectratio(#) Aspect ratio of graph; default is 1.

Control of paths

pathwidth(#) Line width of paths; default is .01.

delta(#) Size of offset between lines.

Other options

options(string) These options are sent to Stata's graph command.

export(string) Name of export file with suffix png for PNG, etc.

sample(0-100) Sample this percent of cases.

How colors are controlled

Colors are controlled by: (1) the hue and (2) the intensity.
The hue is indicated by names such as red (see colorstyle). The
intensity is a number from 0 to 1 for lighter to darker numbers.
Hue and intensity can be controlled with in several ways.

You can control hue and intensity with the options:

cvar() to specify the name of the variable whose categories
determine the color of a path.

colors() controls which colors are used for which categories.

colintensity() specifies the intensity for each color.

For example:

pvplot , ///
colv(sdneighb) colors(red blue orange green)

or:

pvplot , ///
colv(sdneighb) colors(red blue orange green) ///
colintensity(.1 .1 1 1)

Intensity can also by controlled by a variable. For example, here
colors are controled by the first item and intensity by the last item:

pvplot , ///
colv(sdneighb) colors(red blue orange green) ///
int(.25 .5 .75 1) intvar(sdmarry)

You can also control the color by a variable that is not being graphed:

pvplot , ///
colv(nokids) colors(orange green)

Or, let color be controlled by an item and intensity by another variable:

pvplot , ///
colv(sdneighb) colors(red blue orange green) ///
intv(nokids) intensity(.25 1)

If you specify intensity both with colintensity and
intensity, the intensity of a path is a product of the intensity
from colvar and intvar.

Intensities can also be set with decimal digits from 0 to 1. Or, you
can use the text string hi to indicate 1, med for .6,
low or lo for .2.

Interactive mode

Interactive mode makes it simpler to modify an existing graph. To understand
how this works, consider an example. Suppose you create a graph with the
command:

pvplot , ///
colv(sdneighb) colors(red blue orange green) ///
gridspace(3) aspect(1) ///
title("my interactive example", size(small)) ///
caption(Source: mypgm.do - 2008-01-27,size(vsmall)) ///
export("mypgmA.png, replace width(1000)")

I want another graph with different colors exported to a different file. I
do not need to specify the other options. Instead I can use:

pvplot , ///
colors(pink blue orange green) ///
export("mypgmB.png, replace width(1000)")

The pvplot command uses all prior options that have not been explicitly
changed.

Interactive model can be canceled with the intoff option. For example,

pvplot , intoff ///
colors(pink blue orange green) ///
export("mypgmC.png, replace width(1000)")

Since interactive mode is off, the title and captions defined earlier are
not used in this graph.

The global that controls interactive mode is called pvinteractive which
equals 1 if you are interative mode, else 0.