| www.delorie.com/gnu/docs/emacs-lisp-intro/emacs-lisp-intro_278.html | search |
![]() Buy the book! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
print-Y-axis
The 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) |
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.)
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |