octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with plotting (Windows)


From: John W. Eaton
Subject: Problems with plotting (Windows)
Date: Sat, 10 Feb 2007 10:25:26 -0500

On 10-Feb-2007, Michael Goffioul wrote:

| I detected 2 problems in the new plotting system:
| - drawnow.m: use "dumb" terminal is DISPLAY variable is not defined;
| under Windows, this variable is not defined, so adding a "&& isunix()" in
| the test would be OK
| - __uiobject_delete__.m: closing the plot stream is not preceeded by a
| "quit" statement, to close gnuplot properly; this makes the pclose statement
| to hang indefinitely.

OK, I checked in the following changes.  Does this help?

Thanks,

jwe

scripts/ChangeLog:

2007-02-10  John W. Eaton  <address@hidden>

        * plot/drawnow.m: Only check for DISPLAY if isunix returns true.
        * plot/__uiobject_delete__.m: Send quit command and flush stream
        before calling pclose.


Index: scripts/plot/__uiobject_delete__.m
===================================================================
RCS file: /cvs/octave/scripts/plot/__uiobject_delete__.m,v
retrieving revision 1.2
diff -u -u -r1.2 __uiobject_delete__.m
--- scripts/plot/__uiobject_delete__.m  30 Jan 2007 19:16:53 -0000      1.2
+++ scripts/plot/__uiobject_delete__.m  10 Feb 2007 15:25:05 -0000
@@ -32,6 +32,8 @@
       if (strcmp (obj.type, "figure"))
        ps = obj.__plot_stream__;
        if (any (ps == fopen ("all")))
+         fputs (ps, "\nquit;\n");
+         fflush (ps);
          pclose (ps);
        endif
       endif
Index: scripts/plot/drawnow.m
===================================================================
RCS file: /cvs/octave/scripts/plot/drawnow.m,v
retrieving revision 1.4
diff -u -u -r1.4 drawnow.m
--- scripts/plot/drawnow.m      8 Feb 2007 20:06:55 -0000       1.4
+++ scripts/plot/drawnow.m      10 Feb 2007 15:25:05 -0000
@@ -46,7 +46,7 @@
        error ("drawnow: failed to open connection to gnuplot");
       else
        set (h, "__plot_stream__", plot_stream);
-       if (isempty (getenv ("DISPLAY")))
+       if (isunix () && isempty (getenv ("DISPLAY")))
          fprintf (plot_stream, "set terminal dumb\n;");
        endif
       endif

reply via email to

[Prev in Thread] Current Thread [Next in Thread]