print-Y-axis ¶
のほぼ最終版Y-axis-column関数で構築されたリストはprint-Y-axis関数に渡され、同関数はそのリストを列として挿入します。
(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)))
print-Y-axisはinsert-rectangle関数を用いて、Y-axis-column関数で作成されたY軸のラベルを挿入します。さらに、グラフの本体を描画するための適切な位置に点を配置します。
print-Y-axisをテストできます:
Y-axis-label-spacing Y-axis-tic Y-axis-element Y-axis-column print-Y-axis
(print-Y-axis 12 5)
eval-expression)。
graph-body-print 式を C-y
(yank) でミニバッファにヤンクする。
Emacsはラベルを縦方向に出力し、最上部のものは ‘10 - ’ となります。(print-graph 関数は height-of-top-line の値を渡しますが、この場合は 15
となるため、バグのように見える箇所を解消できます。)