anchor.diff:               appending p into xp
                appending q into yq
                finally (return (list xp yq)))
  -        (plot/xy x y
  -                 :aspect aspect
  -                 :palette palette
  -                 :legend legend
  -                 :labels labels
  -                 :width width
  -                 :filename filename
  -                 :format format)))))
  -
  -(defun plot/polar+xya (funcs &key (theta-range (list 0 (+ pi pi))) (a-values '(1.0)) (aspect 1.0) (samples 200) (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) (labels nil) (width 800) (filename "plot2d.pdf") (format :pdf))
  +        (plot/xy x y theme aspect legend labels width filename format)))))
  +
  +(defun plot/polar+xya (funcs theta-range theme a-values aspect samples legend labels width filename format)
     "Plot functions of X and Y parameterized by a. `FUNCS` takes two arguments, theta and a. Each curve should be a pair of functions."
     (flet ((func/a (a f)
              (let* ((theta (loop for x from (first theta-range) to (second theta-range) by (/ (- (second theta-range) (first theta-range)) samples) collect x)))
  
positive.code:                    collect (loop for x in xv collect (first x))))
           (yvals (loop for yv in vals
                     collect (loop for y in yv collect (second y)))))
      (plot/xy xvals yvals :aspect aspect :palette palette :legend legend :labels labels :width width :filename filename :format format :theme theme)))
  
  (defun plot/polar (funcs &key (theta-range (list 0 (+ pi pi))) (aspect 1.0) (samples 200) (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) (labels nil) (width 800) (filename "plot2d.pdf") (format :pdf))
    "Plot a polar-coordinate function (or list of functions). Each function in `FUNCS` takes one arguments, theta."
    (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))
  
negative.code:                 :theme
                  :background
                  :axis-color
                  :axis-font-size
                  :label-color
                  :label-face
                  :label-font-size
                  :legend-color
                  :legend-face
                  :legend-font-size
                  :legend-alpha
                  :legend-placement)
    (:export :plot
             :plot/
             :plot/xy
  