Mercurial > hg > octave-lyh
annotate scripts/plot/private/__errcomm__.m @ 11282:acebc0e675c1
gnuplot_drawnow.m: Remove spurious line causing 'ans=1' to be returned when printing plots.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 20 Nov 2010 16:33:14 -0800 |
parents | 1479b93ee655 |
children | fd0a3ac60b0e |
rev | line source |
---|---|
8920 | 1 ## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 Teemu Ikonen |
4019 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
4019 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
4019 | 18 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
19 ## -*- texinfo -*- |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
20 ## @deftypefn {Function File} {} __errcomm__ (@var{caller}, @var{p}, @dots{}) |
6895 | 21 ## Undocumented internal function. |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
22 ## @end deftypefn |
4019 | 23 |
24 ## Created: 20.02.2001 | |
25 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi> | |
26 ## Keywords: errorbar, plotting | |
27 | |
6404 | 28 function retval = __errcomm__ (caller, p, varargin) |
4019 | 29 |
6257 | 30 if (nargin < 4) |
31 print_usage (); | |
4019 | 32 endif |
33 | |
4897 | 34 nargs = length (varargin); |
10580
1479b93ee655
Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents:
10549
diff
changeset
|
35 retval = []; |
6257 | 36 k = 1; |
37 data = cell(6,1); | |
38 while (k <= nargs) | |
39 a = varargin{k++}; | |
40 if (isvector (a)) | |
41 a = a(:); | |
42 elseif (ismatrix (a)) | |
43 ; | |
44 else | |
45 usage ("%s (...)", caller); | |
4019 | 46 endif |
6257 | 47 sz = size (a); |
48 ndata = 1; | |
49 data{ndata} = a; | |
4897 | 50 while (k <= nargs) |
4019 | 51 a = varargin{k++}; |
6257 | 52 if (ischar (a) || iscellstr (a)) |
10580
1479b93ee655
Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents:
10549
diff
changeset
|
53 retval = [retval; __errplot__(a, p, data{1:ndata})]; |
10549 | 54 break; |
6257 | 55 elseif (isvector (a)) |
10549 | 56 a = a(:); |
4030 | 57 elseif (ismatrix (a)) |
10549 | 58 ; |
4019 | 59 else |
10549 | 60 error ("wrong argument types"); |
6257 | 61 endif |
62 if (size (a) != sz) | |
10549 | 63 error ("argument sizes do not match"); |
4019 | 64 endif |
6257 | 65 data{++ndata} = a; |
66 if (ndata > 6) | |
10549 | 67 error ("too many arguments to a plot"); |
6257 | 68 endif |
4019 | 69 endwhile |
6257 | 70 endwhile |
4019 | 71 |
6257 | 72 if (! (ischar (a) || iscellstr (a))) |
10580
1479b93ee655
Respect linestyleorder in errorbar plots
David Bateman <dbateman@free.fr>
parents:
10549
diff
changeset
|
73 retval = [retval; __errplot__("~", p, data{1:ndata})]; |
6257 | 74 endif |
75 | |
76 drawnow (); | |
4019 | 77 |
78 endfunction |