Next: , Previous: , Up: Print Whole Graph   [Contents][Index]


C.4.1 Testing print-graph

We can test the print-graph function with a short list of numbers:

  1. Install the final versions of Y-axis-column, graph-body-print, and print-graph (in addition to the rest of the code.)
  2. Copy the following expression:
    (print-graph '(3 2 5 6 7 5 3 4 6 4 3 2 1))
    
  3. Switch to the *scratch* buffer and place the cursor where you want the axis labels to start.
  4. Type M-: (eval-expression).
  5. Yank the test expression into the minibuffer with C-y (yank).
  6. Press RET to evaluate the expression.

Emacs will print a graph that looks like this:

10 -


         *
        **   *
 5 -   ****  *
       **** ***
     * *********
     ************
 1 - *************

     |   |    |    |
     1   5   10   15

On the other hand, if you pass print-graph a vertical-step value of 2, by evaluating this expression:

(print-graph '(3 2 5 6 7 5 3 4 6 4 3 2 1) 2)

The graph looks like this:

20 -


         *
        **   *
10 -   ****  *
       **** ***
     * *********
     ************
 2 - *************

     |   |    |    |
     1   5   10   15

(A question: is the ‘2’ on the bottom of the vertical axis a bug or a feature? If you think it is a bug, and should be a ‘1’ instead, (or even a ‘0’), you can modify the sources.)

This page has generated for branch:work/add_lispintr, commit:65845cf60c073f2f3182d1d07483530e9bbe1d96 to check Japanese translation.