# HG changeset patch # User jwe # Date 1159973686 0 # Node ID 004037def470bf57cd0defbd1b2b22527a2844f0 # Parent e282b629db6ff3ecfdd544985bbec21b71bbfefa [project @ 2006-10-04 14:54:46 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,7 +1,10 @@ 2006-10-04 John W. Eaton - * 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 diff --git a/scripts/deprecated/clearplot.m b/scripts/deprecated/clearplot.m 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 diff --git a/scripts/deprecated/clg.m b/scripts/deprecated/clg.m 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 diff --git a/scripts/plot/__clear_plot__.m b/scripts/plot/__clear_plot__.m 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 diff --git a/scripts/plot/__init_plot_vars__.m b/scripts/plot/__init_plot_vars__.m 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 diff --git a/scripts/plot/__setup_plot__.m b/scripts/plot/__setup_plot__.m --- 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 diff --git a/scripts/plot/clf.m b/scripts/plot/clf.m --- 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 diff --git a/scripts/plot/clg.m b/scripts/plot/clg.m 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 diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,7 +1,7 @@ 2006-10-04 John W. Eaton - * 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 diff --git a/src/DLD-FUNCTIONS/__gnuplot_raw__.l b/src/DLD-FUNCTIONS/__gnuplot_raw__.l --- 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 (); }