Table of Contents


snapplot, trakplot - display an N-body snapshot file


snapplot insnap-file [parametervalue] ...


snapplot plots a sequence of frames from a standard N-body snapshot file on a yapp(5NEMO) display device. trakplot is an old name of snapplot that would not erase and redraw the screen after each frame plotted, and could thus be used to show the orbit of the selected points. The later added (boolean) keyword trak= (see below) should now be used to explicitly set the ’trak’ing mode. See also the stack= option in snapgrid(1NEMO)

Arbitrary (algebraic) transformations from particle coordinates to plotting coordinates may be specified; the visibility, point type, and color may be controled in the same way.

In the yt package this is known as PhasePlot.


The following parameters are recognized; they may be given in any order.
Input data is read from snap-file, which must be in snapshot format.
Only plot frames with time values within time-range, which is of the form, eg, "1.0:1.5,2.5,3.0". The default is "all".
The value of x-expression is plotted along the X axis. x-expression is a real-valued C language expression over the real values x, y, z, vx, vy, vz, phi, t, and the integer value i. The default is x.
Label for the X axis. The default is the expression given for xvar.
Range of values for the X axis, specified either as a single number (in which case the lower bound is zero) or a pair of numbers separated by a colon. The default range is -2.0:2.0.
See above. The default is y.
Determines the visibility of particles. expression is a integer expression in the above variables; only points with non-zero values are plotted. Particles are plotted in order of their visib, e.g. visib=1 are plotted before visib=2, thus this keyword can be used to re-arrange the plotting order on screen (useful if colors are used). The default is 1.
Determines the point type and size. expression is a real expression in the above variables; zero means plot a point, positive (negative) means plot a circle (cross) with size controled by absolute value. The default is 0.
Determines the point color. expression is a real expression in the above variables; values between 0 and 1 produce a sequence of saturated colors starting with red, running through the spectrum, and wrapping back to red. The default is 0.
Range of colors that should be mapped. Below and above these ranges the yapp(3NEMO) plotting layer may determine the visibility of the points. The default range is 0:1.


snapplot handles arbitrary C expressions by invoking the compiler, which is general but rather slow. To speed things up, the expressions are first treated as names and checked against a collection of precompiled expressions stored as ".o" files. If a match is found, the precompiled object is used instead. Precompiled transformations include: x, y, z, vx, vy, vz, r, v, vr, vt, jtot, phi, etot, t, and i. A complete list may be deduced by looking in .../nemo/obj/bodytrans/, which is the default repository. It is possible to customize your own transformations and mantain alternate collections; see bodytrans(1NEMO) for more information.


Plot snapshot file "r100.dat" frame-by-frame, with default transformations:

% snapplot r100.dat
Plot radius vs radial velocity at times 2.0 through 6.0:

% snapplot r100.dat xvarr xrange0:2 yvarvr times2:6
Plot binding energy vs angular momentum, showing only the first 1000 particles:

% snapplot r100.dat xvaretot xrange-4:0 \
  xlabel"Binding energy" yvarjtot yrange0:0.8 \
  ylabel"Angular momentum" visib"i < 1000"
NB: this last example assumes that "r100.dat" includes potential data in addition to the usual phase-space data. The expression specified for visib will be passed to the C compiler.

See Also

glnemo2(1NEMO) , snapplot3(1NEMO) , snapplotv(1NEMO) , bodytrans(1NEMO) , uns_2dplot(1NEMO) , snapshot(5NEMO) .


The default ranges should depend on the variables plotted.


Joshua E. Barnes.


28-apr-04    documented history    PJT

Table of Contents