changeset 6030:004037def470

[project @ 2006-10-04 14:54:46 by jwe]
author jwe
date Wed, 04 Oct 2006 14:54:46 +0000
parents e282b629db6f
children fd26599c1841
files scripts/ChangeLog scripts/deprecated/clearplot.m scripts/deprecated/clg.m scripts/plot/__clear_plot__.m scripts/plot/__init_plot_vars__.m scripts/plot/__setup_plot__.m scripts/plot/clf.m scripts/plot/clg.m src/ChangeLog src/DLD-FUNCTIONS/__gnuplot_raw__.l
diffstat 10 files changed, 119 insertions(+), 90 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,7 +1,10 @@
 2006-10-04  John W. Eaton  <jwe@octave.org>
 
-	* plot/__clear_plot__.m: New function.
-	* plot/__setup_plot__.m: Use __clear_plot__.
+	* deprecated/clearplot.m, deprecated/clg.m: New functions.
+
+	* plot/clg.m: Delete.
+	* plot/__init_plot_vars__.m: New function.
+	* plot/__setup_plot__.m: Use __init_plot_vars__.
 
 2006-10-03  Søren Hauberg  <soren@hauberg.org>
 
new file mode 100644
--- /dev/null
+++ b/scripts/deprecated/clearplot.m
@@ -0,0 +1,31 @@
+## Copyright (C) 2006 John W. Eaton
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, write to the Free
+## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+## 02110-1301, USA.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {} clearplot ()
+## This function has been deprecated.  Use clf instead.
+## @end deftypefn
+
+## Author: jwe
+
+function clearplot ()
+
+  clf ();
+
+endfunction
new file mode 100644
--- /dev/null
+++ b/scripts/deprecated/clg.m
@@ -0,0 +1,31 @@
+## Copyright (C) 2006 John W. Eaton
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, write to the Free
+## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+## 02110-1301, USA.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {} clg ()
+## This function has been deprecated.  Use clf instead.
+## @end deftypefn
+
+## Author: jwe
+
+function clg ()
+
+  clf ();
+
+endfunction
deleted file mode 100644
--- a/scripts/plot/__clear_plot__.m
+++ /dev/null
@@ -1,42 +0,0 @@
-## Copyright (C) 2006 John W. Eaton
-##
-## This file is part of Octave.
-##
-## Octave is free software; you can redistribute it and/or modify it
-## under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2, or (at your option)
-## any later version.
-##
-## Octave is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with Octave; see the file COPYING.  If not, write to the Free
-## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-## 02110-1301, USA.
-
-function __clear_plot__ (cmd, sep, clear_data)
-
-  __plot_globals__
-
-  if (nargin < 3)
-    clear_data = true;
-    if (nargin < 2)
-      sep = "";
-      if (nargin < 1)
-	cmd = "";
-      endif
-    endif
-  endif
-
-  __plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__} = cmd;
-  __plot_command_sep__ = sep;
-
-  if (clear_data)
-    __plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__} = [];
-    __plot_data_offset__{__current_figure__}(__multiplot_xi__,__multiplot_yi__) = 1;
-  endif
-
-endfunction
new file mode 100644
--- /dev/null
+++ b/scripts/plot/__init_plot_vars__.m
@@ -0,0 +1,42 @@
+## Copyright (C) 2006 John W. Eaton
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, write to the Free
+## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+## 02110-1301, USA.
+
+function __init_plot_vars__ (cmd, sep, clear_data)
+
+  __plot_globals__
+
+  if (nargin < 3)
+    clear_data = true;
+    if (nargin < 2)
+      sep = "";
+      if (nargin < 1)
+	cmd = "";
+      endif
+    endif
+  endif
+
+  __plot_command__{__current_figure__}{__multiplot_xi__,__multiplot_yi__} = cmd;
+  __plot_command_sep__ = sep;
+
+  if (clear_data)
+    __plot_data__{__current_figure__}{__multiplot_xi__,__multiplot_yi__} = [];
+    __plot_data_offset__{__current_figure__}(__multiplot_xi__,__multiplot_yi__) = 1;
+  endif
+
+endfunction
--- a/scripts/plot/__setup_plot__.m
+++ b/scripts/plot/__setup_plot__.m
@@ -36,6 +36,6 @@
     clear_data = true;
   endif
 
-  __clear_plot__ (cmd, sep, clear_data);
+  __init_plot_vars__ (cmd, sep, clear_data);
 
 endfunction
--- a/scripts/plot/clf.m
+++ b/scripts/plot/clf.m
@@ -25,6 +25,10 @@
 
 function clf ()
 
-  clearplot ();
+  __clear_plot_window__ ();
+
+  hold ("off");
+
+  __init_plot_vars__ ();
 
 endfunction
deleted file mode 100644
--- a/scripts/plot/clg.m
+++ /dev/null
@@ -1,30 +0,0 @@
-## Copyright (C) 2005 John W. Eaton
-##
-## This file is part of Octave.
-##
-## Octave is free software; you can redistribute it and/or modify it
-## under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2, or (at your option)
-## any later version.
-##
-## Octave is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with Octave; see the file COPYING.  If not, write to the Free
-## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-## 02110-1301, USA.
-
-## -*- texinfo -*-
-## @deftypefn {Function File} {} clg
-## Clear the plot window and any titles or axis labels.  This function
-## is equivalent to @code{clearplot}.
-## @end deftypefn
-
-function clg ()
-
-  clearplot ();
-
-endfunction
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,7 @@
 2006-10-04  John W. Eaton  <jwe@octave.org>
 
-	* DLD-FUNCTIONS/__gnuplot_raw__.l (Fclearplot):
-	Also call __clear_plot__.
+	* DLD-FUNCTIONS/__gnuplot_raw__.l (F__clear_plot_window__):
+	Rename from Fclearplot.  Only clear plot window.
 
 2006-10-03  John W. Eaton  <jwe@octave.org>
 
--- a/src/DLD-FUNCTIONS/__gnuplot_raw__.l
+++ b/src/DLD-FUNCTIONS/__gnuplot_raw__.l
@@ -1587,25 +1587,15 @@
   return SET_INTERNAL_VARIABLE (gnuplot_use_title_option);
 }
 
-DEFUN_DLD (clearplot, , ,
+DEFUN_DLD (__clear_plot_window__, , ,
   "-*- texinfo -*-\n\
 @deftypefn {Loadable Function} {} clearplot\n\
 @deftypefnx {Loadable Function} {} clg\n\
-Clear the plot window and any titles or axis labels.  The name\n\
-@code{clg} is aliased to @code{clearplot} for compatibility with\n\
-@sc{Matlab}.\n\
+Clear the plot window and any titles or axis labels.\n\
 @end deftypefn")
 {
   gnuplot::clear ();
 
-  octave_value_list args;
-
-  args(0) = "off";
-  feval ("hold", args);
-
-  args.resize (0);
-  feval ("__clear_plot__", args);
-
   return octave_value_list ();
 }