diff src/pt-plot.cc @ 4879:013350fee837

[project @ 2004-04-23 15:46:29 by jwe]
author jwe
date Fri, 23 Apr 2004 15:46:29 +0000
parents 7b957b442818
children bdbee5282954
line wrap: on
line diff
--- a/src/pt-plot.cc	Fri Apr 23 15:42:10 2004 +0000
+++ b/src/pt-plot.cc	Fri Apr 23 15:46:29 2004 +0000
@@ -59,6 +59,7 @@
 #include "pt-walk.h"
 #include "sighandlers.h"
 #include "sysdep.h"
+#include "unwind-prot.h"
 #include "utils.h"
 #include "variables.h"
 
@@ -942,7 +943,13 @@
 @end deftypefn")
 {
   octave_value_list retval;
-  send_to_plot_stream ("clear\n");
+
+  // We are clearing the plot window, so there is no need to redisplay
+  // after each incremental change to the title, labels, etc.
+
+  unwind_protect_bool (Vautomatic_replot);
+
+  Vautomatic_replot = false;
 
   // XXX FIXME XXX -- instead of just clearing these things, it would
   // be nice if we could reset things to a user-specified default
@@ -954,11 +961,17 @@
   send_to_plot_stream ("set nogrid\n");
   send_to_plot_stream ("set nolabel\n");
 
-  // This makes a simple `replot' not work after a `clearplot' command
-  // has been issued.
+  // Clear the plot display last.
+
+  send_to_plot_stream ("clear\n");
+
+  // Setting plot_line_count to zero makes a simple `replot' not work
+  // after a `clearplot' command has been issued.
 
   plot_line_count = 0;
 
+  unwind_protect::run ();
+
   return retval;
 }