graph 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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 -s
  89. Save screen; no new page for this graph.
  90. .TP
  91. .B -x l
  92. If
  93. .B l
  94. is present,
  95. .IR x -axis
  96. is logarithmic.
  97. Next 1 (or 2) arguments are lower (and upper)
  98. .I x
  99. limits.
  100. Third argument, if present, is grid spacing on
  101. .I x
  102. axis.
  103. Normally these quantities are determined automatically.
  104. .TP
  105. .B -y l
  106. Similarly for
  107. .IR y .
  108. .TP
  109. .B -e
  110. Make automatically determined
  111. .I x
  112. and
  113. .I y
  114. scales equal.
  115. .TP
  116. .B -h
  117. Next argument is fraction of space for height.
  118. .TP
  119. .B -w
  120. Similarly for width.
  121. .TP
  122. .B -r
  123. Next argument is fraction of space to move right before plotting.
  124. .TP
  125. .B -u
  126. Similarly to move up before plotting.
  127. .TP
  128. .B -t
  129. Transpose horizontal and vertical axes.
  130. (Option
  131. .B -a
  132. now applies to the vertical axis.)
  133. .PP
  134. If a specified lower limit exceeds the upper limit,
  135. the axis
  136. is reversed.
  137. .SH SOURCE
  138. .B /sys/src/cmd/graph
  139. .SH "SEE ALSO"
  140. .IR plot (1),
  141. .IR grap (1)
  142. .SH BUGS
  143. Segments that run out of bounds are dropped, not windowed.
  144. Logarithmic axes may not be reversed.
  145. Option
  146. .B -e
  147. actually makes automatic limits, rather than automatic scaling,
  148. equal.