Axis takes input plot values from standard input. The input values can be interspersed with commands specifying the various plot options. Alternatively, plot options can be specified on the command line. Axis output is in Unix Plot(5) format. This plot ouput can then be passed through a filter appropriate to the desired plotting device. There is a filter for putting the plot in an X-window screen. There are also filters for converting the plot into a graphics print file for a variety of printers.
The simplest implementation of axis involves simply giving it a list of x,y pairs as follows:
1.0 1.0 2.0 2.1 3.0 2.9Axis will draw line segments connecting the three points. It will choose an appropriate scale for the x and y axis. If you are going to enter these numbers from the keyboard and want to see the graph on your screen, simply type
axis | xplotto filter the axis output through the xplot filter, that puts the graph on your screen, and then type in the lines as shown. Hit C-d to signal a keyboard end of file. The plot is then drawn. Hit q (or C-c in some versions) to signal xplot that you want to quit.
If your data is in a file called input, then you may use redirection to get the same result:
axis < input | xplot
To set the x range to the interval [0,1.5], you may use
axis -x 0 1.5 < input | xplotor you may modify the input data file by adding a line;
#x 0 1.5 0.0 1.0 1.0 2.0 2.0 3.0Notice that the option is specified with a hyphen on the command line, and by a separate line with a # in the input file. All of the axis options work this way. In this course we will put commands in the input data file most of the time.
The complete documentation for axis and a list of options can be found from axis.ps.