anchor.diff:                        *width*)))
              (ty (y)
                (- height (+ by (* ry (/ (- y miny) (- maxy miny))
  -                      height)))))
  +                      height))))
  +           (max-extents (l)
  +             (let ((cnv (mapcar #'(lambda (x) (multiple-value-list (text-extents x))) l)))
  +               (loop for i from 0 to 3 collect
  +                    (loop for x in cnv maximizing (nth i x) into z finally (return z))))))
  +                  
         (setf *context* (create-context surface))
         (destroy surface)
         (apply #'set-source-rgb background)
  
positive.code:               do (if flag
                       (move-to (tx x) (ty y))
                       (line-to (tx x) (ty y))))
             (stroke)))
        ;; draw title
      (destroy *context*)))
  
  
negative.code:   (remove-if #'(lambda (n) (or (< n x) (> n y))) 
               (loop for i from (floor x) to (ceiling y) by 0.5 collect i)))
  
  (defun strcat (l &optional (ret nil))
    (if l
        (strcat (cdr l) (concatenate 'string ret (car l) (string #\Newline)))
        (string-trim '(#\Newline) ret)))
  
  (defun thin (n l)
    (loop for i from 0 to (1- (length l)) by (ceiling (/ (length l) n)) collect (nth i l)))
  
  (defun plot2d (funcs &key (x-axis (list -2 2)) (aspect 1.0) (samples 100) (background (list 0.2 0.2 0.2)) (palette '((1.0 0.2 0.2) (0.2 1.0 0.2) (0.2 0.2 1.0)))
                         (legend nil))
    (let* ((funcs (if (listp funcs) funcs (list funcs)))
           (colors (loop for x in funcs appending (loop for y in palette collect y)))
           (dx (- (second x-axis) (first x-axis)))
  