/* * ppmplot - generate plots as PPM files. * * Command line consists of datafiles intermixed with plot directives. * If no datafiles are specified, stdin is read after the command line * has been processed, even if "read" directives appear on the command * line. Directives on the command line are just like directives as * described below, except that each directive name or argument must * be exactly one command-line argument. Directives with optional * arguments must have all optional arguments present. There is no * explicit disambiguation between directive names and filenames; * since no directive begins with "/" or "./", it is always possible * to ensure that file names cannot be mistaken for directives. * * Data files consist of sequences of plot directives. Directives in * data files begin at the first nonblank character available and * extend through the next newline or semicolon; comments begin with # * and extend through the next newline. They differ from directives * on the command line in having semicolon terminators and in * supporting comments. Note that comments include the trailing * newline; when a line ends with a comment, the newline is deleted * before it has a chance to act as a directive terminator. * * In the descriptions below, uppercase indicates variables and [ ] * indicates that what's within them is optional. Most arguments are * numbers; when reading from a file, string arguments such as * filenames support quoting with " ", ' ', and \ (\ quotes characters * even within "" or ''); even ; and # may be quoted. When reading * from the command line, command-line argument boundaries indicate * directive argument boundaries. * * read FILENAME * Read the named file, processing directives contained * within it. When done reading it, continue processing * further directives following the read. These may be * nested as deeply as available resources permit. * end * No further directives will be read from this source. * clear XSIZE YSIZE [R [G B]] * clear same [R [G B]] * Sets the size of the plot, in pixels, and clears the * plot. It does not affect other parameters, such as the * the foreground colour setting. If "same" is given for * the size, the size is unchanged; this is not allowed * unless a size has been given on the command line or by * a previous clear line. If a colour is given, it is * interpreted as described for fg lines, and it clears * the entire plot to that colour. The default clear-to * colour is 0. * size XSIZE YSIZE * size same * This is just like "clear", except that it never takes * an RGB triple. It exists mainly for use from the * command line. * scale XMIN XMAX YMIN YMAX * scale default * Sets scaling. For further plotting, the output file is * considered to run from XMIN to XMAX in the X direction * and YMIN to YMAX in the Y direction. The default scale * is equivalent to "scale 0 XSIZE 0 YSIZE", where XSIZE * and YSIZE are as given on the command line or with a * clear line; this default scale can be restored with the * "scale default" form. Pixels are considered to be * rectangles in user coordinate space, with edges evenly * spaced such that the left edge of the leftmost pixel is * coordinate XMIN and the rightmost edge of the rightmost * pixel is coordinate XMAX, with similar remarks, mutatis * mutandis, applying to the Y direction. Arguments where * XMIN>XMAX produces a reversed X axis; it is not valid * to specify XMIN and XMAX equal. Similar remarks apply * for Y. Boundary points belong to the lower coordinate * (which also means that points with coordinates equal to * XMIN or YMIN will fall off the plot). * fg R [G B] * Sets the colour of plotted points. If only one * argument is given, it is a greyscale value; if three * are given, they are an RGB triple (which is taken as a * greyscale value if all three values are the same). * Values run from 0 to 255 and must be integers. If the * background and all plotted points are greyscale 0 or * greyscale 1, a PBM file is output; otherwise, the * output is PGM or PPM (depending on whether any * non-greyscale colours are used). The default * foreground is 1. * type TYPE * TYPE can be pbm, pgm, or ppm to override the default * output type (see fg, above, for a description of the * default), or default, to specify that the default is to * be used. If pbm is specified and non-PBM colours are * used, any non-black pixel becomes white; if pgm is * specified and non-greyscale colours are used, they are * converted using the usual .299r\&+.587g\&+.114b * formula. * op OP * Sets the operation used to combine plotted points with * data already there. The OP is a string naming a * combination method: * set The new data replaces the old. * min The minimum of the old data and the new is * used, independently for each primary. * max The maximum of the old data and the new is * used, independently for each primary. * point X Y * Draws a point at the pixel containing (X,Y). * line X1 Y1 X2 Y2 * Draws a line from (X1,Y1) to (X2,Y2). This is almost, * but not quite, the same as drawing a line from the * pixel containing (X1,Y1) to the pixel containing * (X2,Y2); the difference lies in exactly where the * jaggies fall. #if 0 * circle S F X Y R * Draws a circle. S and F are two letters indicating the * coordinate system the circle is drawn in and whether it * is drawn outlined or filled. S can be u or p, * indicating that the circle is to be circular in ser * space or
ixel space; this also indicates which
* coordinate system the radius value is in. F is o or f,
* indicating the circle is to be drawn