Skip to documentation
DocumentationAll documentsEnglish

PLOT3LINE2(1)

NAME

plot3line2 - output a 2D UNIX plot line segment

On this page

SYNOPSIS

plot3line2 x1 y1 x2 y2 [r g b] [< unix_plot] > unix_plot

DESCRIPTION

plot3line2 writes a plot3(5) (UNIX plot) command to draw a line in the XY plane from the point (x1, y1) to the point (x2, y2). The coordinates may be floating point, and the segment is always emitted as a double-precision plotting command. If an integer-format command is required, pass the output through plot3-plot3(1).

If the optional color triple r g b is supplied (each an integer from 0 to 255 specifying the red, green, and blue intensities), a color command is written before the line and the segment is drawn in that color. Otherwise the current drawing color (white by default) is used.

To allow use within a pipeline, if standard input is not a terminal its entire contents are copied through to standard output first, and the new line segment is appended at the end. The command refuses to run when standard output is a terminal.

This command exists mainly as an aid for building plots and graphs from shell scripts.

EXAMPLES

Example 1. Draw a red diagonal segment on top of an existing plot
plot3line2 0 0 100 100 255 0 0 < base.plot3 > annotated.plot3

This copies the contents of base.plot3 to annotated.plot3 and appends a red line from the origin to (100, 100), letting you overlay an annotation on an existing UNIX plot file.

Example 2. Build a plot incrementally in a pipeline
plot3line2 0 0 50 80 |
    plot3line2 50 80 100 0 0 255 0 |
    plot3-plot3 > graph.plot3

The first plot3line2 emits one segment; the second reads it from standard input, copies it through, and appends a second (green) segment. The combined double-precision stream is converted to integer plot commands by plot3-plot3(1) and saved as graph.plot3.

SEE ALSO

brlcad(1), plot3color(1), plot3-plot3(1), plot3(5)

AUTHOR

BRL-CAD Team

This software is Copyright (c) 1986-2026 by the United States Government as represented by U.S. Army Research Laboratory.

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org