anchor.diff:        (destructuring-bind (x y)
             (list (mapcar #'(lambda (x) (func/r x)) xfuncs)
                   (mapcar #'(lambda (x) (func/r x)) yfuncs))
  -        (plot/xy x y theme aspect legend labels width filename format)))))
  -
  -(defclass plot2d ()
  -  ((theme :accessor theme :initarg :theme :initform (make-instance 'theme))
  -   (width :accessor width :initarg :width :initform 800)
  -   (aspect :accessor aspect :initarg :aspect :initform 1)
  -   (format :accessor get-format :initarg :format :initform 'pdf)
  -   (labels :accessor get-labels :initarg :labels :initform nil)
  -   (legend :accessor legend :initarg :legend :initform nil)
  -   (samples :accessor samples :initarg :samples :initform 200)
  -   (range :accessor range :initarg :range :initform '(-2 2))))
  -
  -(defclass parameterized (plot2d)
  -  ((a-values :accessor a-values :initarg :a-values :initform nil)))
  -
  -(defclass polar-r (plot2d) ())
  -
  -(defclass polar-ra (parameterized) ())
  -
  -(defclass polar-xy (plot2d) ())
  -
  -(defclass polar-xya (parameterized) ())
  -  
  -(defgeneric generate (gen funcs))
  -
  -(defmethod generate ((gen plot2d) funcs)
  -  (plot/ funcs (range gen) (theme gen) (aspect gen) (samples gen) (legend gen) (get-labels gen) (width gen) (filename gen) (get-format gen)))
  -
  -(defmethod generate ((gen polar-r) funcs)
  -  (plot/polar funcs (range gen) (theme gen) (aspect gen) (samples gen) (legend gen) (get-labels gen) (width gen) (filename gen) (get-format gen)))
  -
  -(defun plot (gen funcs &key filename width theme range aspect format labels legend)
  +        (plot+xy x y (theme gen) (aspect gen) (legend gen) (get-labels gen) (width gen) (filename gen) (get-format gen))))))
  +
  +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  +;; toplevel functions
  +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  +
  +(defun plot (gen funcs &key filename width theme range aspect format labels legend samples)
     (when width
       (setf (width gen) width))
     (when range
  
positive.code:              appending xl into xp
               appending yl into yp
               finally (return (list xp yp)))
          (plot/xy x y theme aspect legend labels width filename format)))))
  
  (defun plot/polar+xy (funcs theta-range theme aspect samples legend labels width filename format)
    "Plot polar functions of X and Y. Each `FUNCS` takes one argument, theta. Each curve should be a pair of functions."
    (flet ((func/r (f)
             (let* ((theta (loop for x from (first theta-range) to (second theta-range) by (/ (- (second theta-range) (first theta-range)) samples) collect x)))
               (loop for n in theta collecting (funcall f n)))))
      (destructuring-bind (xfuncs yfuncs) 
          (loop for f in funcs
  
negative.code:          (ry (/ (- height by by) height))
           (surface
            (cond 
              ((eq format 'pdf) (create-pdf-surface filename width height))
              ((eq format 'svg) (create-svg-surface filename width height))
              ((eq format 'ps) (create-ps-surface filename width height))
              (t (error "invalid file format")))))
      (flet ((tx (x)
               (+ bx (* rx (/ (- x minx) (- maxx minx))
  