Mercurial > hg > octave-lyh
annotate scripts/plot/__plt2__.m @ 8624:ff7d90d92db8
gnuplot_drawnow.m: style fixes.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Wed, 28 Jan 2009 21:57:27 -0500 |
parents | 0dff8d9bf229 |
children | 7d48766c21a5 |
rev | line source |
---|---|
7017 | 1 ## Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2005, 2006, 2007 |
2 ## John W. Eaton | |
2313 | 3 ## |
4 ## This file is part of Octave. | |
5 ## | |
6 ## Octave is free software; you can redistribute it and/or modify it | |
7 ## under the terms of the GNU General Public License as published by | |
7016 | 8 ## the Free Software Foundation; either version 3 of the License, or (at |
9 ## your option) any later version. | |
2313 | 10 ## |
11 ## Octave is distributed in the hope that it will be useful, but | |
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 ## General Public License for more details. | |
15 ## | |
16 ## You should have received a copy of the GNU General Public License | |
7016 | 17 ## along with Octave; see the file COPYING. If not, see |
18 ## <http://www.gnu.org/licenses/>. | |
933 | 19 |
6895 | 20 ## Undocumented internal function. |
3402 | 21 |
2314 | 22 ## Author: jwe |
23 | |
6459 | 24 function retval = __plt2__ (h, x1, x2, options, properties) |
933 | 25 |
6459 | 26 if (nargin < 3 || nargin > 5) |
6046 | 27 print_usage (); |
933 | 28 endif |
29 | |
6264 | 30 if (nargin < 4 || isempty (options)) |
31 options = __default_plot_options__ (); | |
933 | 32 endif |
33 | |
6459 | 34 if (nargin < 5) |
35 properties = {}; | |
36 endif | |
37 | |
6264 | 38 if (! isstruct (options)) |
39 error ("__plt1__: options must be a struct array"); | |
933 | 40 endif |
41 | |
42 if (any (any (imag (x1)))) | |
43 x1 = real (x1); | |
44 endif | |
5115 | 45 |
933 | 46 if (any (any (imag (x2)))) |
47 x2 = real (x2); | |
48 endif | |
5115 | 49 |
6302 | 50 h_set = false; |
7664
0dff8d9bf229
Fix for plot(zeros(1,0),zeros(1,0))
David Bateman <dbateman@free.fr>
parents:
7290
diff
changeset
|
51 if (isempty (x1) && isempty (x2)) |
0dff8d9bf229
Fix for plot(zeros(1,0),zeros(1,0))
David Bateman <dbateman@free.fr>
parents:
7290
diff
changeset
|
52 retval = zeros (0, 1); |
0dff8d9bf229
Fix for plot(zeros(1,0),zeros(1,0))
David Bateman <dbateman@free.fr>
parents:
7290
diff
changeset
|
53 elseif (isscalar (x1)) |
4030 | 54 if (isscalar (x2)) |
6459 | 55 retval = __plt2ss__ (h, x1, x2, options, properties); |
7290 | 56 elseif (isvector (x2)) |
57 retval = __plt2sv__ (h, x1, x2, options, properties); | |
5115 | 58 else |
59 error ("__plt2__: invalid data for plotting"); | |
933 | 60 endif |
4030 | 61 elseif (isvector (x1)) |
7290 | 62 if (isscalar (x2)) |
63 retval = __plt2vs__ (h, x1, x2, options, properties); | |
64 elseif (isvector (x2)) | |
6459 | 65 retval = __plt2vv__ (h, x1, x2, options, properties); |
4030 | 66 elseif (ismatrix (x2)) |
6459 | 67 retval = __plt2vm__ (h, x1, x2, options, properties); |
5115 | 68 else |
69 error ("__plt2__: invalid data for plotting"); | |
933 | 70 endif |
4030 | 71 elseif (ismatrix (x1)) |
72 if (isvector (x2)) | |
6459 | 73 retval = __plt2mv__ (h, x1, x2, options, properties); |
4030 | 74 elseif (ismatrix (x2)) |
6459 | 75 retval = __plt2mm__ (h, x1, x2, options, properties); |
5115 | 76 else |
77 error ("__plt2__: invalid data for plotting"); | |
933 | 78 endif |
5115 | 79 else |
80 error ("__plt2__: invalid data for plotting"); | |
933 | 81 endif |
82 | |
83 endfunction |