ag - Ascii Graph
ag [option ...] [file ...]
AG draws graph on terminal with ascii characters. The graph is controled by key commands. Zoom/unzoom, toggle of log/linear scale, scroll viewing range, and so on are supported. See KEYS sections in detail. The format of input data follows xgraph(1)'s format. A simple example data is:"Label of data set"
1.0 2.0
2.0 4.0"Next data set"
1.0 1.0
-1.0 -1.0
move -1.0 1.0
1.0 -1.0Each data set is separated by break line. When there is "move" before X,Y data, the line is not drawed from the previous data. X resources are ignored. And, data which is separated by comma(,) are also permitted.
- -bg background
- Specifies the background color of the graph. The following color names are accepted.
bla[ck], r[red], b[lue], g[reen], m[agenta],
y[ellow], c[yan], w[hite]The default value is "black".
- -c colors
- Specifies colors for data sets. Colors is separated by comma(,). The color names accepted are same as -bg option's. When the number of the colors is less than the number of data set, the colors repeat. The default value is "r,b,g,m,y,c".
- -fg foreground
- Specifies the foreground color of the graph. The color names accepted are same as -bg option's. The default value is "white".
- -g
- Turns on drawing the grid. By default, the grid is drawed.
- -h
- Display a usage message and exit the program.
- -lnx
- Force a logarithmic X axis.
- -lny
- Force a logarithmic Y axis.
- -lx xmin,xmax
- Limits the range of the X axis. If the option value is "auto", the range is automatically calculated. The default value is "auto".
- -ly ymin,ymax
- Limits the range of the Y axis. If the option value is "auto", the range is automatically calculated. The default value is "auto".
- -m marker_types
- Specifies the marker types for data sets with ASCII characters. When the length of the specified characters is less than the number of data set, the characters repeat. The default value is "xo*+@".
- -M
- Turns on using mouse on xterm/kterm. In the case that the terminal type ($TERM) is "xterm" or "kterm", the mouse is availabe.
- -ng
- Turns off drawing grid. By default, the grid is drawed.
- -nl
- Turns off drawing the lines. By default, the lines is drawed.
- -nm
- Turns off drawing the markers. By default, the markders is drawed.
- -nM
- Turns off using mouse.
- -rv
- Reverse video. Swaps the foreground and background colors.
- -t title
- Specifies the graph title. The default value is "Ascii Graph".
- -T term
- Specifies the terminal type instead of $TERM.
- -v
- Output version and exit the program.
- -x x_axis_name
- Specifies the name of the X axis. The default value is "X-Axis".
- -y y_axis_name
- Specifies the name of the Y axis. The default value is "Y-Axis".
- -z zoom_ratio
- Specifies the zoom ratio. The default value is "0.5" (double zoom).
There are five modes ("Graph mode", "Crop mode", "X(Y)-Axis mode", "List mode" and "Help mode"). Most commands accept the previous number N (= 1-9999) for repetition.
- [N] l, <RIGHT>
- Move the coursor right one column (N columns).
- [N] h, <LEFT>
- Move the coursor left one column (N columns).
- [N] j, <DOWN>
- Move the coursor down one line (N lines).
- [N] k, <UP>
- Move the coursor up one line (N lines).
- [N] L
- Move the coursor right to the (N'th) next point.
- [N] H
- Move the coursor left to the (N'th) next point.
- [N] J
- Move the coursor down to the (N'th) next point.
- [N] K
- Move the coursor up to the (N'th) next point.
- [N] .
- Scroll screen one column (N columns) right.
- [N] ,
- Scroll screen one column (N columns) left.
- [N] f
- Scroll screen one line (N lines) down.
- [N] b
- Scroll screen one line (N lines) up.
- [N] >
- Scroll screen one page (N pages) right.
- [N] <
- Scroll screen one page (N pages) left.
- [N] F, <CNTL>-F
- Scroll screen one page (N pages) down.
- [N] B, <CNTL>-B
- Scroll screen one page (N pages) up.
- [N] n
- Move the cursor to the (N'th) next data point.
- [N] p
- Move the cursor to the (N'th) previous data point.
- [N] N, <CNTL>-N
- Move the cursor to the (N'th) next data set.
- [N] P, <CNTL>-P
- Move the cursor to the (N'th) previous data set.
- <SPACE>, <RETURN>
- Make the data set on the cursor active. The marker of an active data set is made reverse.
- <TAB>
- Toggle active/inactive.
- a
- Force auto scale.
- [N] z
- Zoom. In the case that "N" is specified, the zoom magnification is "N". Otherwise, it is 1/zoom_ratio.
- [N] Z
- Unzoom (N times).
- c
- Start the crop. The mode becomes "Crop mode".
- g
- Toggle drawing grid.
- *
- Toggle drawing markers. If there is an active data set, only drawing the markers of the active data set is toggled.
- +
- Toggle drawing lines. If there is an active data set, only drawing the lines of the active data set is toggled.
- x
- The mode becomes "X-Axis mode".
- y
- The mode becomes "Y-Axis mode".
- v
- List X,Y values of data. The mode becomes "List mode".
- q
- Quit with confirmation.
- Q
- Quit without confirmation.
- <CNTL>-L
- Redraw.
- ?
- Display a help message. The mode becomes "Help mode".
- l, <RIGHT>, h, <LEFT>, j, <DOWN>, k, <UP>, L, H, J, K,
- q, Q, <CNTL>-L
- Same as "Graph mode".
- <SPACE>, <RETURN>
- Define the crop range.
- Other
- Return to "Graph mode".
- l
- Toggle log/linear scale for the X(Y) axis.
- r
- Reverse the range of the X(Y) axis.
- a
- Force auto scale for the X(Y) axis.
- [N] z
- Zoom the X(Y) axis.
- q, Q, <CNTL>-L
- Same as "Graph mode".
- Other
- Return to "Graph mode".
- [N] j, <DOWN>
- Scroll screen one line (N lines) down.
- [N] k, <UP>
- Scroll screen one line (N lines) up.
- [N] f, <SPACE>, <RETURN>
- Display the (N'th) next page.
- [N] b
- Display the (N'th) previous page.
- [N] n
- List the (N'th) next data set.
- [N] p
- List the (N'th) previous data set.
- <CNTL>-L
- Redraw.
- Other
- Return to "Graph mode".
- [N] j, <DOWN>
- Scroll screen one line (N lines) down.
- [N] k, <UP>
- Scroll screen one line (N lines) up.
- [N] f, <SPACE>, <RETURN>
- Display the (N'th) next page.
- [N] b
- Display the (N'th) previous page.
- <CNTL>-L
- Redraw.
- Other
- Return to "Graph mode".
The mouse is available on xterm or kterm. And it works in "Graph mode".
- Click
- In the case that there is a marker of data on the cursor and the mouse is clicked on the cursor, make the data set active. In the case that the mouse is clicked on the label of data in the left of the graph, make the data set active. In the other case, move the cursor to the click point.
- Drag
- Scroll.
- Click
- Unzoom.
- Drag
- Ignore.
- Click
- Zoom.
- Drag
- Crop.
When the terminal is resized, the program may not work well.When the mouse is active on xterm or kterm, it doesn't work well after suspend.
Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
http://www2u.biglobe.ne.jp/~hsaka/ag/ (Japanese only)
xgraph(1), ncurses(3)