(require 'cgn) (progn (use-package :cgn) (use-package :ltk)) (defun image-example () (with-ltk () (let ((image0 (make-image)) (image1 (make-image)) (image2 (make-image))) (image-load image0 "test.gif") (image-load image1 "test.gif") (let ((canvas (make-instance 'canvas))) (create-image canvas 0 0 :image image0) (create-image canvas 0 481 :image image1) (configure canvas :width 640) (configure canvas :height 960) (pack canvas))))) (defun make-images (filename &optional (title "Data Images") (xlabel "X-RI") (ylabel "Y-RI") (zlabel "LR")) "Note: filename should be a string of an already existing,properly formatted gnuplot-readable file." (with-ltk () (let* ((canvas (make-instance 'canvas)) (image0 (make-image)) (image1 (make-image)) (image2 (make-image))) (with-gnuplot ( 'linux) (format-gnuplot "reset") (set-title title) (format-gnuplot (format nil "set xlabel \"~a\"" xlabel)) (format-gnuplot (format nil "set ylabel \"~a\"" ylabel)) (format-gnuplot (format nil "set zlabel \"~a\"" zlabel)) (format-gnuplot "set terminal gif") (format-gnuplot "set size .6,.6") (format-gnuplot "set view 65,15") (format-gnuplot "set output \"0.gif\"") (format-gnuplot (format nil "splot '~a'" filename)) (format-gnuplot "set view 85,315") (format-gnuplot "set output \"1.gif\"") (format-gnuplot (format nil "splot '~a'" filename)) (format-gnuplot "set view 0,360") (format-gnuplot "set output \"2.gif\"") (format-gnuplot (format nil "splot '~a'" filename))) (image-load image0 "0.gif") (image-load image1 "1.gif") (image-load image2 "2.gif") (create-image canvas 0 0 :image image0) (create-image canvas 0 289 :image image1) (create-image canvas 0 578 :image image2) (configure canvas :width 384) (configure canvas :height 865) (pack canvas)))) (defun demo-make-images () (make-images "randomdata.dat"))