... This describes how the axes for the graph are drawn. A is a line description, e.g., or the literal If the first is given, the frame is drawn with that style. The default is The height and width of the frame can also be specified in inches. The default line style can be over-ridden for sides of the frame by specifying additional parameters to If no plotting commands have been given before the command is issued, the frame will be output at that point in the plotting stream relative to embedded or commands. Otherwise the frame is output before the first plotted object (even invisible ones). The command specifies a new coordinate system or sets limits on the default system. It defines the largest and smallest values that can be plotted, and therefore the scale of the data in the frame. The limits for the x and y coordinate systems can be given separately. If a is given, that coordinate system is defined, if not the default system is modified. A coordinate system created by one command may be modified by subsequent commands. A program may declare a coordinate space using a file of data through a macro that plots the data and finds its maxima and minima, and then define the size of the coordinate system with a second statement. This command also determines if a scale is plotted logarithmically. means the same thing as The command defines the style with which a given line will be plotted. If is given, the style is associated with that name, otherwise the default style is set. is a line description, and the optional is a string to be centered at each point. The default line description is and the default plotting string is a centered bullet, so by default each point is a filled circle, and they are unconnected. If points are being connected, each command ends any current line and begins a new one. When defining a line style, that is the first command for a given line name, specifying no plot string means that there are to be no plot strings. Omitting the plot string on subsequent commands addressing the same named line means not to change the plot string. If a line has been defined with a plot string, and the format is changed by a subsequent statement, the plot string can be removed by specifying "" in the statement. is a synonym for The command plots the given point using the line style given by or the default if none is given. If is given, it should have been defined by an earlier command, if not a new line style with that name is created, initialized the same way as the default style. The two expressions give the point's x and y values, relative to the optional coordinate system. That system should have been defined by an earlier command, if not, grap will exit. If the optional is given, it overrides the style's default line description. You cannot over-ride the plotting string. To use a different plotting string use the command. The coordinates may optionally be enclosed in parentheses: ... These commands both plot a string at the given point. In the first case the literal strings are stacked above each other. The string modifiers include the justification modifiers, and absolute and relative modifiers.
behave as expected. A separator is also appended to the end of a block. This command executes iteratively. The variable is set to and incremented by until it exceeds The iteration has the semantics defined in the command. The definition of is discussed in See also the note about implicit separators in the description of the command. An can be used in place of supports a most standard arithmetic operators: + - / * ^. The carat (^) is exponentiation. In an statement also supports the C logical operators ==, !=, &&, || and unary !. Also in an == and != are overloaded for the comparison of quoted strings. Parentheses are used for grouping. Assignment is not allowed in an expression in any context, except for simple cascading of assignments. works as expected; does not execute. supports the following functions that take one argument: The logarithms are base 10 and the trigonometric functions are in radians. returns Euler's number to the given power and returns the natural logarithm. The natural log and exponentiation functions are extensions and are probably not available in other implementations. If is given an argument, it seeds the random number generator with that value. Called with no arguments, it returns a random number uniformly distributed on [0,1). The following two argument functions are supported: works just like Other than string comparison, no expressions can use strings. One string valued function exists: ). It operates like except returning the value. It can be used anywhere a quoted string is used. has a simple but powerful macro facility. Macros are defined using the command : Every occurrence of in the program text is replaced by the contents of is defined by a series of statements in nested { }'s, or a series of statements surrounded by the same letter. An example of the latter is define foo X coord x 1,3 X Each time appears in the text, it will be replaced by Macros are literal, and can contain newlines. If a macro does not span multiple lines, it should end in a semicolon to avoid parsing errors. Macros can take parameters, too. If a macro call is followed by a parenthesized, comma-separated list the values starting with $1 will be replaced in the macro with the elements of the list. A $ not followed by a digit is left unchanged. This parsing is very rudimentary, no nesting or parentheses or escaping of commas is allowed. Also, there is no way to say argument 1 followed by a digit (${1}0 in sh(1) ). A macro can have at most 32 arguments. The following will draw a line with slope 1. define foo { next at $1, $2 } for i from 1 to 5 { foo(i,i) } Macros persist across graphs. The file contains simple macros for plotting common characters. See the file for more examples of macros. A whitespace-separated list of numbers is treated specially. The list is taken to be points to be plotted using the default line style on the default coordinate system. If more than two numbers are given, the extra numbers are taken to be additional y values to plot at the first x value. Number lists in DWB can be comma-separated, and this supports that as well. More precisely, numbers in number lists can be separated by either whitespace, commas, or both. 1 2 3 4 5 6
Will plot points using the default line style at (1,2), (1,3),(4,5) and (4,6). A simple way to plot a set of numbers in a file named is: copy "./data"