unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (plan9)
Page:
Section:
Apropos / Subsearch:
optional field

PLOT(6)                          Games Manual                          PLOT(6)



NAME
       plot - graphics interface

DESCRIPTION
       Files of this format are interpreted by plot(1) to draw graphics on the
       screen.  A plot file is a UTF stream of instruction  lines.   Arguments
       are  delimited  by  spaces,  tabs,  or commas.  Numbers may be floating
       point.  Punctuation marks (except , spaces, and tabs at  the  beginning
       of  lines  are  ignored.   Comments run from to newline.  Extra letters
       appended to a valid instruction are ignored.  Thus all  mean  the  same
       thing.  Arguments are interpreted as follows:

       1.     If an instruction requires no arguments, the rest of the line is
              ignored.

       2.     If it requires a string argument, then all the  line  after  the
              first field separator is passed as argument.  Quote marks may be
              used to preserve leading blanks.  Strings may  include  newlines
              represented as

       3.     Between  numeric arguments alphabetic characters and punctuation
              marks are ignored.  Thus line from 5 6 to 7 8 draws a line  from
              (5, 6) to (7, 8).

       4.     Instructions with numeric arguments remain in effect until a new
              instruction is read.  Such commands may spill over  many  lines.
              Thus  the  following  sequence will draw a polygon with vertices
              (4.5, 6.77), (5.8, 5.6), (7.8, 4.55), and (10.0, 3.6).

              move 4.5 6.77
              vec 5.8, 5.6 7.8
              4.55 10.0, 3.6 4.5, 6.77

       The instructions are executed in order.  The last designated point in a
       line,  move,  rmove, vec, rvec, arc, or point command becomes the `cur-
       rent point' (X,Y) for the next command.

   Open && Close
       o string  Open plotting device.  For troff, string specifies  the  size
                 of the plot (default is

       cl        Close plotting device.

   Basic Plotting Commands
       e         Start another frame of output.

       m x y     (move) Current point becomes x y.

       rm dx dy  Current point becomes X+dx Y+dy.

       poi x y   Plot the point x y and make it the current point.

       v x y     Draw a vector from the current point to x y.

       rv dx dy  Draw vector from current point to X+dx Y+dy

       li x1 y1 x2 y2
                 Draw  a  line from x1 y1 to x2 y2.  Make the current point x2
                 y2.

       t string  Place the string so that its first character is  centered  on
                 the  current  point  (default).   If string begins with it is
                 centered (right-adjusted) on the current point.  A  backslash
                 at  the  beginning  of the string may be escaped with another
                 backslash.

       a x1 y1 x2 y2 xc yc r
                 Draw a circular arc from x1 y1 to x2 y2 with center xc yc and
                 radius  r.  If the radius is positive, the arc is drawn coun-
                 terclockwise; negative, clockwise.   The  starting  point  is
                 exact but the ending point is approximate.

       ci xc yc r
                 Draw  a circle centered at xc yc with radius r.  If the range
                 and frame parameters do not specify a  square,  the  `circle'
                 will be elliptical.

       di xc yc r
                 Draw a disc centered at xc yc with radius r using the filling
                 color (see cfill below).

       bo x1 y1 x2 y2
                 Draw a box with lower left corner at x1 y1  and  upper  right
                 corner at x2 y2.

       sb x1 y1 x2 y2
                 Draw  a  solid  box with lower left corner at x1 y1 and upper
                 right corner at x2 y2 using  the  filling  color  (see  cfill
                 below).

       par x1 y1 x2 y2 xg yg
                 Draw  a  parabola from x1 y1 to x2 y2 `guided' by xg yg.  The
                 parabola passes through the midpoint of the line  joining  xg
                 yg  with the midpoint of the line joining x1 y1 and x2 y2 and
                 is tangent to the lines from xg yg to the endpoints.

       pol { {x1 y1 ... xn yn} ... {X1 Y1 ... Xm Ym} }
                 Draw polygons with vertices x1 y1 ... xn yn and X1 Y1 ...  Xm
                 Ym.  If only one polygon is specified, the inner brackets are
                 not needed.

       fi { {x1 y1 ... xn yn} ... {X1 Y1 ... Xm Ym} }
                 Fill a polygon.  The arguments are the same as those for  pol
                 except  that  the  first  vertex is automatically repeated to
                 close each polygon.  The polygons do  not  have  to  be  con-
                 nected.  Enclosed polygons appear as holes.

       sp { {x1 y1 ... xn yn} ... {X1 Y1 ... Xm Ym} }
                 Draw a parabolic spline guided by x1 y1 ... xn yn with simple
                 endpoints.

       fsp { {x1 y1 ... xn yn} ... {X1 Y1 ... Xm Ym} }
                 Draw a parabolic spline guided by x1 y1 ... xn yn with double
                 first endpoint.

       lsp { {x1 y1 ... xn yn} ... {X1 Y1 ... Xm Ym} }
                 Draw a parabolic spline guided by x1 y1 ... xn yn with double
                 last endpoint.

       dsp { {x1 y1 ... xn yn} ... {X1 Y1 ... Xm Ym} }
                 Draw a parabolic spline guided by x1 y1 ... xn yn with double
                 endpoints.

       csp { {x1 y1 ... xn yn} ... {X1 Y1 ... Xm Ym} }

       in filename
                 (include) Take commands from filename.

       de string { commands }
                 Define string as commands.

       ca string scale
                 Invoke commands defined as string applying scale to all coor-
                 dinates.

   Commands Controlling the Environment
       co string Draw lines with color string.  Possible colors:  black,  red,
                 green, blue, Tblack, Tred, Tgreen, Tblue

       pe string Use string as the style for drawing lines.  The available pen
                 styles are: solid, dott[ed], short, long, dotd[ashed], cdash,
                 ddash

       cf string Color for filling (see co, above).

       ra x1 y1 x2 y2
                 The data will fall between x1 y1 and x2 y2.  The plot will be
                 magnified or reduced to fit the device as closely  as  possi-
                 ble.

                 Range settings that exactly fill the plotting area with unity
                 scaling appear below for devices supported by the filters  of
                 plot(1).   The upper limit is just outside the plotting area.
                 In every case the plotting area is taken to be square; points
                 outside may be displayable on devices with nonsquare faces.

       fr px1 py1 px2 py2
                 Plot the data in the fraction of the display specified by px1
                 py1 for lower left corner and px2 py2 for upper right corner.
                 Thus  plots  in the lower right quadrant of the display; uses
                 the whole display but inverts the y coordinates.

       sa        Save the current environment, and move to a new one.  The new
                 environment inherits the old one.  There are 7 levels.

       re        Restore previous environment.

SEE ALSO
       plot(1), graph(1)



                                                                       PLOT(6)