diff scripts/plot/drawnow.m @ 6419:73fcbac81f33

[project @ 2007-03-20 17:18:24 by jwe]
author jwe
date Tue, 20 Mar 2007 17:18:24 +0000
parents 2efe282221ed
children 0cc5ca7b1e91
line wrap: on
line diff
--- a/scripts/plot/drawnow.m	Tue Mar 20 16:46:47 2007 +0000
+++ b/scripts/plot/drawnow.m	Tue Mar 20 17:18:24 2007 +0000
@@ -46,10 +46,6 @@
         cmd = sprintf ("%s -title \"Figure %d\"", cmd, h);
       endif
       plot_stream = popen (cmd, "w");
-      if (isempty (__go_close_all_registered__))
-	atexit ("__go_close_all__");
-	__go_close_all_registered__ = true;
-      endif
       if (plot_stream < 0)
 	error ("drawnow: failed to open connection to gnuplot");
       else
@@ -57,6 +53,10 @@
 	if (isunix () && isempty (getenv ("DISPLAY")))
 	  fprintf (plot_stream, "set terminal dumb\n;");
 	endif
+	if (isempty (__go_close_all_registered__))
+	  atexit ("__go_close_all__");
+	  __go_close_all_registered__ = true;
+	endif
       endif
     endif