User Tools

Site Tools


CIGAL Reference Manual, Chapter 2 (Commands): AXIS

AXIS -- Draw a coordinate axis for a graph or histogram

usage: axis varb flag label lcol lwid x0 y0 lng ntik v0 vmax tsz lsz nsz prec

The AXIS command draws a horizontal or vertical axis, including an axis label and a number scale. The normal usage of AXIS is to specify the data variable to be plotted along that axis and let the AXIS command automatically determine appropriate scaling parameters depending on the values within that variable. Actually plotting the data is accomplished by the PLOT(2) or HISTOGRAM(2) commands, which use the scaling parameters stored by the AXIS command.

You can override any or all of the automatic axis parameters by specifying the appropriate optional arguments with the AXIS command. If you specify the minimum and maximum values (V0 and VMAX) you need not specify the VARB argument (remember to use the '-' character when omitting an argument). If the VARB argument is a number, the axis range (V0 → VMAX) is taken to be the range 0 → VARB-1.

A typical example of using AXIS and PLOT to make a graph of two array variables, VARB1 and VARB2, would be:

        axis varb1 1 'Y Axis Label'
        axis varb2 2 'X Axis Label'
        plot varb1 varb2

Or to make a histogram of values in array VARB1:

        axis varb1 1 'Y Axis Label'
        axis size(varb1) 6 'X Axis Label'
        histogram varb1

You can add more data to the graph with additional calls to PLOT(2) (or HISTOGRAM(2)); the scaling parameters remain unchanged until the next call to AXIS.

FLAG controls various AXIS options; you can combine options by adding values:

     1   reset origin and scale to initial default values
     2   draw a horizontal axis (otherwise vertical axis)
     4   put numbers between tick (i.e., for HISTOGRAM); otherwise at ticks
     8   log axis
    16   save vectors (usually they are not entered into stored vector list)
    32   integer numbers only along axis
    64   don't start at 0 -- make the variables low to high values fill most
          of the axis range
   128   place text above axis (if horizontal) or to the right (if vertical)
          (normally text is below horizontal or to the left of vertical axes)
   256   don't draw tick marks
   512   don't draw numbers along the axis
  1024   don't flip Y values (assume origin lower, not upper, left)

See Also:

CIGAL Home, CIGAL Manual, Commands List, Manual Help

jvs/cigal/manual/chapter2/axis.txt · Last modified: 2023/02/23 18:43 (external edit)