Table of Contents


tabplot - general table plotter


tabplot in=infile [parameter=value]


tabplot plots datapoints from an ascii table, optionally connects the datapoints by lines, plots different styles for the points and (if available) uses different colors. It can also bin the data in X, and compute/plot error-bars in X and Y derived from the dispersion within those bins.

tabplot can also plot one-to-many, many-to-one as well as pair-wise plotting. However, it is (not yet) possible to pair-wise plot from multiple files with different number of rows. See also paste(1) or tabmath(1NEMO) how to combine tables.

tabplot is really intended for quick and dirty display of the data. For more complicated plots, full plotting packages should be used (Mongo, SM, WIP, gnuplot, Grace, matplotlib etc.), though moderately sophisticated plots can also be made using layout=. The readline= is available to give some degree of interactive usage.


The following parameters are recognized in any order if the keyword is also given:
input file, in (ASCII) tabular format [no default].
column(s) from which the X values are taken. Multiple columns can be taken, but if so, the number of Y columns must be the same for pairwise plotting. [default 1].
column from which the Y values are taken. Multiple columns can be given. The number of X columns can either be 1 or must be equal to the number of Y columns. [default 2].
Minimum value along X-axis to include [default: minimum of datapoints].
Maximum value along X-axis to include [default: maximum of datapoints].
Minimum value along y-axis to include [default: minimum of datapoints].
Maximum value along y-axis to include [default: maximum of datapoints].
When used either the number of datapoints used to average to a plotted datapoint or the bin boundaries (in X-world-coordinates) must be given. The program can distinguish from both cases by the number of variables given to this keyword. One means fixed number of datapoints used in averaging, more than one means the numbers are bin boundaries. The output is controlled using tab= and contains the mean X, Y followed by the dispersion in X and Y and the number of points in that bin. [default: not used, datapoints from file are used].
Pairs of integers, (one pair for each plotted column) describing the point type (0=none, 1=point, 2=circle, 3=plus, 4=square) and size in cm (see also yapp(3NEMO) ). Pairs not specified inherit from the last one entered. Default: 1,0.1
Pairs of integers, (one pair for each plotted column) describing the line type and width (see plltype(3NEMO) ). Default: 0,0
Integer denoting color. This will be yapp(3NEMO) specific. Colors not specified will inherit from the last one entered. Default: not used (i.e. default drawing color used)
Specify which error bars to draw in case binning is used. If error bars are used in either raw X or Y columns, this option cannot be used. Default: none.
Label along the X-axis [default: X].
Label along the Y-axis [default: Y].
A list of numbers (see nemoinp(3NEMO) for valid syntax) that will cause vertical lines at these X coordinate to be drawn. Default: none
Y coordinates for the horizontal lines, same as xcoord=.
Extent of the plotting frame in the X direction. [Default: 2:18]
Extent of the plotting frame in the Y direction. [Default: 2:18]
Number of tickmarks along the X axis. This divides the X axis in nxticks+1 pieces. [Default: 7].
Same for Y.
Scaling factor applied to all X values. Default: 1
Scaling factor applied to all Y values. Default: 1
Columns representing error bars in X. These currently need to match the xcol=. By default no error column(s) are used.
Columns representing error bars in Y. These currently need to match the ycol=. By default no error column(s) are used.
Maximum number of lines that are allocated in pipes. [10000]
Use median to compute "average" binning values. It is used to compute the X as well as Y coordinates of the binned point, however error bars are still computed using the mean. Default: f.
Random verbiage, will be plotted along right top of plot for id. [default: none]. The left top will contain the filename infile.
Output table to stdout if binning is used? Default: false;
Use full scale in one axis if other axis is autoscaled? In versions older than 2.0 fullscale was always on (t), by default it is now off (f).
This will be the name of an ascii file that will contain coordinates that have been marked with the cursor, not the nearest datapoint (currently only implemented for PGPLOT). Cursor keys are in the usual definition: A=left mouse will mark, D=middle mouse has no function, X=right mouse will exit. Default: not used.
Optional Layout file that contains draw commands. Default: none.
Should the layout file be called first or last ? [f]
After all batch plotting is done, should an interactive layout annotator (see also layout(5NEMO) ) be called. [f]


tab= doesn’t work properly with multiple columns


Here is an example working with layout files.
  % nemoinp 1:20 | tabmath - -  ’ranu(0,1),ranu(0,1)’ all >
  % tabmath - ’2+%1*16,2+%2*16,0.2’ all | awk ’{print "circle",$0}’ > ran.layout
  % tabplot 1 2 0 1 0 1 layout=ran.layout
It plots the data points from the file as dots, and converts, using tabmath and awk, these to a layout file where the same points as plotted as open circles in ran.layout. Note that currently the user has to convert to yapp (cm) units, and actually know that most yapp plots runs from 2 to 18 cm in both X and Y. This will likely change in a future version where points can be given in a more reasonably WCS.

Here are some examples of plotting multiple columns/rows, assuming each example of the tab1 and tab2 table has 2 columns:

   % paste tab1 tab2 | tabplot - 1 4                     headline=x1,y2
   % tabmath tab1,tab2 - %1-%3,%2-%4 all | tabplot - 1 2 headline=dx,dy
   % paste tab1 tab2 | tabplot - 1,3 2                   headline=x1,x2,y1
   % paste tab1 tab2 | tabplot - 1   2,4                 headline=x1,y1,y2
   % paste tab1 tab2 | tabplot - 1,2 3,4                 headline=(x1,y1),(x2,y2)

See Alsotablsqfit(1NEMO), tabmath(1NEMO), yapp(5NEMO) 
AuthorPeter Teuben Files
~/src/kernel/tab    tabplot.c

Update History

25-nov-88    V1.0 - created      PJT
13-nov-90    V1.1 deleted nmax= by using file_lines()    PJT
26-jan-95    V1.5a multi-column plotting support, trickmarks, extra coord lines    PJT
14-feb-96    V1.6 added cursor= keyword (*PGPLOT only*)    PJT
7-may-98    V2.0 added median= for binning method    PJT
25-jul-98    V2.0b added line=lwidth,lstyle w/ lstyle<0 histogram (thank Kartik)    PJT
31-mar-99    V2.1 autoscaling now takes range in other axis into account    PJT
28-jul-99    V2.2 added color=
21-jul-00    V2.3 min & max can be separately set    PJT
2-aug-02    V2.5 allow number of x columns to be > 1    PJT
17-sep-05    V2.8 added readline= and documented first=    PJT
2-dec-05    V2.9 implemented missing many-to-one plotting mode    PJT
20-dec-05    V3.0 added xscale,yscale and started dxcol,dycol. Fixed xbin= bug    PJT
10-oct-06    V3.0e finished dxcol=, dycol=    PJT

Table of Contents