anchor.diff:  (defparameter *gnuplot-path* #p"/usr/bin/gnuplot")
   (defparameter *gnuplot-args* '("-persist"))
   (defparameter *gnuplot-process* nil)
  +;; Thanks http://yujianzhang.blogspot.com/2007/12/nicer-fonts-for-gnuplot.html
  +(defparameter *gnuplot-font* "/usr/share/fonts/bitstream-vera/Vera.ttf,12")
   
  -(defmacro with-plot (stream &body body)
  +(defmacro with-plot ((stream &optional terminal pathspec) &body body)
  +  (when (and (member terminal '(:eps :ps :png :jpg))
  +	     (not pathspec))
  +    (error "Attempting to plot to a file with no pathspec given"))
     `(let ((gnuplot (ensure-gnuplot-connection)))
  -     (unwind-protect
  -	  (with-open-stream (,stream (external-program:process-input-stream gnuplot))
  -	    (format ,stream "set term x11~%")
  -	    ,@body)
  -;       (external-program:process-close gnuplot)
  -)))
  +     (with-open-stream (,stream (external-program:process-input-stream gnuplot))
  +					;with-open-file (,stream #p"./test" :direction :output :if-exists :supersede)
  +       (format ,stream "set term ~a font ~S~%" (string-downcase ,terminal) *gnuplot-font*)
  +       (when ,pathspec (format ,stream "set output ~S~%" (namestring ,pathspec)))
  +       ,@body)))
   
   (defun close-gnuplot-connection ()
     (when *gnuplot-process*
  
positive.code: 	     do (format stream "~1,8f ~1,8f~%" xi yi))
  	  (format stream "e~%"))
  
  (defun plot (&rest args)
    ;; Let's say things are (x y title) for now
    (with-plot stream
      (if (consp (car args))
  
  	;; List of things to plot
  	(progn
  	  (loop for plot in (car args)
  	     do (format stream "plot '-' using 1:2 ~a" (parse-style (third plot)))
  	     unless (eql plot (car (last (car args))))
  	     do (format stream ","))
  	       
  	  (loop for plot in (car args)
  	     do (destructuring-bind (x y nil) plot
  		  (print-vectors-to-stream stream x y)))) ; hah! second-class functions to the rescue!
  	
  
  	;; One thing to plot, yay!
  	(let ((x (first args))
  	      (y (second args))
  	      (style (parse-style (third args))))
  	  (format stream "plot '-' using 1:2 ~a~%" style)
  	  (print-vectors-to-stream stream x y)))))
  
  (defun image (data)
    (with-plot s
      (format s "set pm3d map~%")
      (format s "splot '-' matrix~%")
      (loop for i from (1- (array-dimension data 1)) downto 0
         do (loop for j from 0 upto (1- (array-dimension data 0))
  
negative.code: 				    :input :stream))
        *gnuplot-process*))
  
  (defun parse-style (stream style-number args)
    ;; Do we have a title?  Print it first
  
    (format stream "set style line ~d " style-number)
    ;; More style directives?  They live together
  
    (if args
        (destructuring-bind (&key line-type line-color line-width point-type point-size &allow-other-keys) args
  	(when line-type (format stream "lt ~a " line-type))
  	(when line-color (format stream "lc ~a " line-color))
  	(when line-width (format stream "lw ~a " line-width))
  	(when point-type (format stream "pt ~a " point-type))
  	(when point-size (format stream "ps ~a " point-size))
  	(format stream "~%"))
        (format stream "default~%")))
  
  (defun print-vectors-to-stream (stream x y)
  	  (loop for xi across x
  