gnuplot error



On 8/2/08, Andreas J Guelzow <aguelzow at math.concordia.ab.ca> wrote:

>  (%i1) plot2d(sin(x),[x,-10,10]);
>
>  gnuplot> set term default
>                   ^
>          line 0: unknown or ambiguous terminal type; type just 'set
>  terminal' for a list

Yeah, that's pretty annoying. Maxima should always output a valid
Gnuplot terminal type.

I've applied the following patch, which seems to make this problem go away.

HTH

Robert Dodier

PS.
diff -u -r1.128 plot.lisp
--- src/plot.lisp       27 Jul 2008 07:04:12 -0000      1.128
+++ src/plot.lisp       3 Aug 2008 17:39:49 -0000
@@ -169,10 +169,20 @@

 (defun $gnuplot_reset ()
   (send-gnuplot-command "unset output")
-  (send-gnuplot-command (format nil "set term ~a"
-                                (get-plot-option-string '$gnuplot_term)))
+  (send-gnuplot-command (format nil "set term ~a"
(translate-gnuplot-term-option)))
   (send-gnuplot-command "reset"))

+;; If embedded in output, the gnuplot_term option makes Gnuplot unhappy,
+;; so translate gnuplot_term into something Gnuplot actually wants to see.
+;; Logic copied from GNUPLOT-PRINT-HEADER.
+
+(defun translate-gnuplot-term-option ()
+  (case ($get_plot_option '$gnuplot_term 2)
+    ($default (get-plot-option-string '$gnuplot_default_term_command))
+    ($ps (get-plot-option-string '$gnuplot_ps_term_command))
+    ($dumb (get-plot-option-string '$gnuplot_dumb_term_command))
+    (t (get-plot-option-string '$gnuplot_term))))
+
 (defun $gnuplot_replot (&optional s)
   (if (null *gnuplot-stream*)
       (merror "Gnuplot is not running."))