graph 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. .TH GRAPH 1
  2. .CT 1 numbers graphics
  3. .SH NAME
  4. graph \- draw a graph
  5. .SH SYNOPSIS
  6. .B graph
  7. [
  8. .I option ...
  9. ]
  10. .SH DESCRIPTION
  11. .I Graph
  12. with no options takes pairs of numbers from the
  13. standard input as abscissas
  14. .RI ( x -values)
  15. and ordinates
  16. .RI ( y -values)
  17. of a graph.
  18. Successive points are connected by straight lines.
  19. The graph is encoded on the standard output
  20. for display by
  21. .IR plot (1)
  22. filters.
  23. .PP
  24. If an ordinate is followed by
  25. a nonnumeric string, that string is printed as a
  26. label beginning on the point.
  27. Labels may be surrounded with quotes
  28. .L
  29. " "
  30. in which case they may be empty or contain blanks
  31. and numbers;
  32. labels never contain newlines.
  33. .PP
  34. The following options are recognized,
  35. each as a separate argument.
  36. .TP
  37. .B -a
  38. Supply abscissas automatically; no
  39. .IR x -values
  40. appear in the input.
  41. Spacing is given by the next
  42. argument (default 1).
  43. A second optional argument is the starting point for
  44. automatic abscissas (default 0, or 1
  45. with a log scale in
  46. .IR x ,
  47. or the lower limit given by
  48. .BR -x ).
  49. .TP
  50. .B -b
  51. Break (disconnect) the graph after each label in the input.
  52. .TP
  53. .B -c
  54. Character string given by next argument
  55. is default label for each point.
  56. .TP
  57. .B -g
  58. Next argument is grid style,
  59. 0 no grid, 1 frame with ticks, 2 full grid (default).
  60. .TP
  61. .B -l
  62. Next argument is a legend to title the graph.
  63. Grid ranges
  64. are automatically printed as part
  65. of the title unless a
  66. .B -s
  67. option is present.
  68. .TP
  69. .B -m
  70. Next argument is mode (style)
  71. of connecting lines:
  72. 0 disconnected, 1 connected.
  73. Some devices give distinguishable line styles
  74. for other small integers.
  75. Mode \-1 (default) begins with style 1 and
  76. rotates styles for successive curves under option
  77. .BR -o .
  78. .TP
  79. .B -o
  80. (Overlay.)
  81. The ordinates for
  82. .I n
  83. superposed curves appear in the input
  84. with each abscissa value.
  85. The next argument is
  86. .IR n .
  87. .TP
  88. .B -p
  89. Next argument is one or more of the characters
  90. .B bcgkmrwy,
  91. choosing pen colors by their initial letter, as in
  92. .IR plot (6).
  93. Successive curves will cycle through the colors in the given order.
  94. .TP
  95. .B -s
  96. Save screen; no new page for this graph.
  97. .TP
  98. .B -x l
  99. If
  100. .B l
  101. is present,
  102. .IR x -axis
  103. is logarithmic.
  104. Next 1 (or 2) arguments are lower (and upper)
  105. .I x
  106. limits.
  107. Third argument, if present, is grid spacing on
  108. .I x
  109. axis.
  110. Normally these quantities are determined automatically.
  111. .TP
  112. .B -y l
  113. Similarly for
  114. .IR y .
  115. .TP
  116. .B -e
  117. Make automatically determined
  118. .I x
  119. and
  120. .I y
  121. scales equal.
  122. .TP
  123. .B -h
  124. Next argument is fraction of space for height.
  125. .TP
  126. .B -w
  127. Similarly for width.
  128. .TP
  129. .B -r
  130. Next argument is fraction of space to move right before plotting.
  131. .TP
  132. .B -u
  133. Similarly to move up before plotting.
  134. .TP
  135. .B -t
  136. Transpose horizontal and vertical axes.
  137. (Option
  138. .B -a
  139. now applies to the vertical axis.)
  140. .PP
  141. If a specified lower limit exceeds the upper limit,
  142. the axis
  143. is reversed.
  144. .SH SOURCE
  145. .B /sys/src/cmd/graph
  146. .SH "SEE ALSO"
  147. .IR plot (1),
  148. .IR grap (1)
  149. .SH BUGS
  150. Segments that run out of bounds are dropped, not windowed.
  151. Logarithmic axes may not be reversed.
  152. Option
  153. .B -e
  154. actually makes automatic limits, rather than automatic scaling,
  155. equal.