Node:print-Y-axis Penultimate, Previous:Y-axis-column, Up:print-Y-axis
print-Y-axisThe list constructed by the Y-axis-column function is passed to
the print-Y-axis function, which inserts the list as a column.
(defun print-Y-axis (height full-Y-label-width)
"Insert Y axis using HEIGHT and FULL-Y-LABEL-WIDTH.
Height must be the maximum height of the graph.
Full width is the width of the highest label element."
;; Value of height and full-Y-label-width
;; are passed by `print-graph'.
(let ((start (point)))
(insert-rectangle
(Y-axis-column height full-Y-label-width))
;; Place point ready for inserting graph.
(goto-char start)
;; Move point forward by value of full-Y-label-width
(forward-char full-Y-label-width)))
The print-Y-axis uses the insert-rectangle function to
insert the Y axis labels created by the Y-axis-column function.
In addition, it places point at the correct position for printing the body of
the graph.
You can test print-Y-axis:
Y-axis-label-spacing Y-axis-tic Y-axis-element Y-axis-column print-Y-axis
(print-Y-axis 12 5)
*scratch* buffer and place the cursor where you
want the axis labels to start.
eval-expression).
graph-body-print expression into the minibuffer
with C-y (yank).
Emacs will print labels vertically, the top one being
10 - . (The print-graph function
will pass the value of height-of-top-line, which
in this case would end up as 15.)