ANN Search Tree Visualization

ANN_TO_FIG is a C++ program which displays an image of the search tree used by the ANN program.

ANN_TO_FIG expects as input a dump file created by the ANN_TEST program. It creates a file in the FIG format, which can be displayed by the XFIG program, or converted to other formats using the FIG2DEV program.


ann_to_fig -upiscale -xxoffset -yyoffset -szsize -dxdimx -dxdimy -sldim AND value -pspointsize file
reads the ANN_TEST dump file file.dmp and creates the FIG format file file.fig.
-upi scale
specifies the number of FIG units per inch (default is 1200);
-x xoffset
sets the x offset of the bounding box (default 1 inch).
-y yoffset
sets the y offset of the bounding box (default 1 inch).
-sz size
specifies the length of the longer side of the box (default 5 inches).
-dx dimx
the first plane dimension (default is "0", meaning the first coordinate);
-dy dimy
the second plane dimension (default is "1", meaning the second coordinate);
-sl dim AND value
specifies a slicing pair as a dimension and a slicing value.
-ps pointsize
specifies the radius of circles used for drawing points (default is 10 FIG units).


ANN_TO_FIG is available in a C++ version.

Related Data and Programs:

ANN, a C++ library which rapidly approximates the nearest neighbor of a point.

ANN_TEST, a C++ program which uses the ANN library, and carries out approximate nearest neighbor computations.

FIG, a data directory which contains examples and a description of the FIG format.


David Mount, Sunil Arya.


  1. David Mount,
    The ANN Programming Manual.
  2. Sunil Arya, David Mount, Nathan Netanyahu, Ruth Silverman, Angela Wu,
    An Optimal Algorithm for Approximate Nearest Neighbor Searching in Fixed Dimensions,
    Journal of the ACM,
    Volume 45, Number 6, November 1998, pages 891-923.
  3., the web site.
    The XFIG Home Page.

Source Code:

Examples and Tests:

You can go up one level to the C++ source codes.

Last revised on 15 May 2006.