help-octave
[Top][All Lists]
Advanced

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

Re: plot.m using __plt__,m


From: Shai Ayal
Subject: Re: plot.m using __plt__,m
Date: Sun, 17 Jul 2005 16:38:49 +0300
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

Henry,

if you would have looked at __plt__.m you would see that it calls __pltopt__ which calls __plotopt1__ which does the actual work. This is called procedural programming, and the above example shows that it is not always good to use it :)

the use of __ in many some programming languages (C,C++) means these functions are "internal", not to be used by normal users under normal conditions. I suppose this is the meaning here too.

Shai

p.s. a good way to see the code of an m-file is using the "type" command, e.g. type __pltopt__

Henry F. Mollet wrote:
On previous octave version (2.1.46) I had used posted changes for
"__pltopt1__.m" so I could use "k" for a black line.

On new eMac with Octave 2.1.71 I wanted the same changes. I thought the
changes were to be made in plot.m and I accidentally found that the changes
were to be made in __pltopt1__.m.

How could I have determined from the code in plot.m (see below) that it was
using __pltopt1__.m to do the actual plotting? I only see __plt__ .

Also, what is the meaning of "__" before and after the name of the function,
in this case pltopt1?
Henry

function plot (varargin)

  ## XXX FIXME XXX -- these plot states should really just be set
  ## temporarily, probably inside an unwind_protect block, but there is
  ## no way to determine their current values.

  __gnuplot_set__ nologscale;
  __gnuplot_set__ nopolar;

  __plt__ ("plot", varargin{:});

Endfunction

function fmt = __pltopt1__ (caller, opt)
CUT
% Changes needed for color black:
    %elseif (strcmp (char, "w") || strcmp (char, "k"))  % Nov 21 2004
    elseif (strcmp (char, "k"))             % Nov 21 2004
        set_color = 1;                    % Nov 21 2004
        color = "-1";                    % Nov 21 2004
    elseif (strcmp (char, "w"))                % Nov 21 2004
CUT
endfunction




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



--
Shai Ayal, Ph.D.
Head of Research
BioControl Medical BCM
3 Geron St.
Yehud 56100
ISRAEL
Tel:  + 972 3 6322 126 ext 223
Fax:  + 972 3 6322 125
email: address@hidden



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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