annotate scripts/plot/private/__plt__.m @ 17475:fd01c78caa0b

Added tag ss-3-7-7 for changeset cc13924a4266
author John W. Eaton <jwe@octave.org>
date Mon, 23 Sep 2013 13:31:11 -0400
parents 1dfc3abb0f0d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 12339
diff changeset
1 ## Copyright (C) 1993-2012 John W. Eaton
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
2 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
3 ## This file is part of Octave.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
4 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
8 ## your option) any later version.
2313
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
9 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
13 ## General Public License for more details.
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
14 ##
5ca126254d15 [project @ 1996-07-11 21:25:22 by jwe]
jwe
parents: 2303
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
17 ## <http://www.gnu.org/licenses/>.
245
16a24e76d6e0 [project @ 1993-12-03 02:00:15 by jwe]
jwe
parents: 4
diff changeset
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} {} __plt__ (@var{caller}, @var{h}, @var{varargin})
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6459
diff changeset
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
3402
9610d364e444 [project @ 2000-01-05 04:36:38 by jwe]
jwe
parents: 3178
diff changeset
23
2314
949ab8eba8bc [project @ 1996-07-12 03:58:02 by jwe]
jwe
parents: 2313
diff changeset
24 ## Author: jwe
949ab8eba8bc [project @ 1996-07-12 03:58:02 by jwe]
jwe
parents: 2313
diff changeset
25
6302
a5cd8b77e892 [project @ 2007-02-13 08:08:33 by jwe]
jwe
parents: 6264
diff changeset
26 function retval = __plt__ (caller, h, varargin)
5406
c49aec8a9080 [project @ 2005-07-08 15:25:43 by jwe]
jwe
parents: 5395
diff changeset
27
17396
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
28 persistent warned_callers = {};
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6172
diff changeset
29 nargs = nargin - 2;
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 6004
diff changeset
30
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6172
diff changeset
31 if (nargs > 0)
934
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
32
5116
67320fb4ae5c [project @ 2005-01-25 03:57:01 by jwe]
jwe
parents: 5115
diff changeset
33 k = 1;
5119
f394f83ee1c4 [project @ 2005-01-25 22:34:05 by jwe]
jwe
parents: 5118
diff changeset
34
f394f83ee1c4 [project @ 2005-01-25 22:34:05 by jwe]
jwe
parents: 5118
diff changeset
35 x_set = false;
f394f83ee1c4 [project @ 2005-01-25 22:34:05 by jwe]
jwe
parents: 5118
diff changeset
36 y_set = false;
6459
5dc550e1f419 [project @ 2007-03-26 18:11:58 by jwe]
jwe
parents: 6405
diff changeset
37 property_set = false;
5dc550e1f419 [project @ 2007-03-26 18:11:58 by jwe]
jwe
parents: 6405
diff changeset
38 properties = {};
934
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
39
12339
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
40 hlegend = [];
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14431
diff changeset
41 fkids = get (gcf (), "children");
14868
5d3a684236b0 maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents: 14846
diff changeset
42 for i = 1 : numel (fkids)
17129
b5d6314314fc Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents: 16889
diff changeset
43 if ( strcmp (get (fkids(i), "type"), "axes")
b5d6314314fc Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents: 16889
diff changeset
44 && strcmp (get (fkids(i), "tag"), "legend"))
b5d6314314fc Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents: 16889
diff changeset
45 udata = get (fkids(i), "userdata");
12339
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
46 if (! isempty (intersect (udata.handle, gca ())))
17129
b5d6314314fc Change various plot functions to take advantage of new isaxes() function.
Rik <rik@octave.org>
parents: 16889
diff changeset
47 hlegend = fkids(i);
12339
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
48 break;
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
49 endif
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
50 endif
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
51 endfor
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
52
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
53 setlgnd = false;
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
54 if (isempty (hlegend))
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
55 hlgnd = [];
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
56 tlgnd = {};
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
57 else
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
58 [hlgnd, tlgnd] = __getlegenddata__ (hlegend);
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
59 endif
10995
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
60
5116
67320fb4ae5c [project @ 2005-01-25 03:57:01 by jwe]
jwe
parents: 5115
diff changeset
61 ## Gather arguments, decode format, gather plot strings, and plot lines.
934
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
62
6405
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents: 6302
diff changeset
63 retval = [];
b298a4c12fc3 [project @ 2007-03-14 16:51:28 by jwe]
jwe
parents: 6302
diff changeset
64
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6172
diff changeset
65 while (nargs > 0 || x_set)
5115
57372235194b [project @ 2005-01-24 18:38:45 by jwe]
jwe
parents: 4717
diff changeset
66
5119
f394f83ee1c4 [project @ 2005-01-25 22:34:05 by jwe]
jwe
parents: 5118
diff changeset
67 if (nargs == 0)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
68 ## Force the last plot when input variables run out.
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
69 next_cell = {};
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
70 next_arg = {""};
5118
ecbb290ba9ff [project @ 2005-01-25 22:10:26 by jwe]
jwe
parents: 5117
diff changeset
71 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
72 next_cell = varargin(k);
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
73 next_arg = varargin{k++};
5116
67320fb4ae5c [project @ 2005-01-25 03:57:01 by jwe]
jwe
parents: 5115
diff changeset
74 endif
934
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
75
17396
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
76 if (isnumeric (next_arg) && ndims (next_arg) > 2
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
77 && any (size (next_arg) == 1))
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
78 next_arg = squeeze (next_arg);
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
79 if (! any (strcmp (caller, warned_callers)) && ndims (next_arg) < 3)
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
80 warning (["%s: N-d inputs have been squeezed to less than " ...
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
81 "three dimensions"], caller)
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
82 warned_callers(end+1) = caller;
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
83 endif
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
84 endif
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
85 if (isnumeric (next_arg) && ndims (next_arg) > 2)
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
86 error ("%s: plot arrays must have less than 2 dimensions", caller)
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
87 endif
e04847bbcfdf Squeeze Nd > 2 plot vectors.
Ben Abbott <bpabbott@mac.com>
parents: 17273
diff changeset
88
6257
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6172
diff changeset
89 nargs--;
44c91c5dfe1d [project @ 2007-01-30 19:16:52 by jwe]
jwe
parents: 6172
diff changeset
90
6146
1a6d826e92b5 [project @ 2006-11-09 03:13:11 by jwe]
jwe
parents: 6004
diff changeset
91 if (ischar (next_arg) || iscellstr (next_arg))
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
92 if (x_set)
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
93 [options, valid] = __pltopt__ (caller, next_arg, false);
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
94 if (! valid)
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
95 if (nargs == 0)
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
96 error ("%s: properties must appear followed by a value", caller);
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
97 endif
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
98 properties = [properties, [next_cell, varargin(k++)]];
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
99 nargs--;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
100 continue;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
101 else
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
102 while (nargs > 0 && ischar (varargin{k}))
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
103 if (nargs < 2)
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
104 error ("%s: properties must appear followed by a value",
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
105 caller);
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
106 endif
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
107 properties = [properties, varargin(k:k+1)];
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
108 k += 2;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
109 nargs -= 2;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
110 endwhile
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
111 endif
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
112 if (y_set)
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
113 tmp = __plt2__ (h, x, y, options, properties);
12339
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
114 [hlgnd, tlgnd, setlgnd] = __plt_key__ (tmp, options, hlgnd, tlgnd, setlgnd);
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
115 properties = {};
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
116 retval = [retval; tmp];
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
117 else
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
118 tmp = __plt1__ (h, x, options, properties);
12339
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
119 [hlgnd, tlgnd, setlgnd] = __plt_key__ (tmp, options, hlgnd, tlgnd, setlgnd);
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
120 properties = {};
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
121 retval = [retval; tmp];
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
122 endif
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
123 x_set = false;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
124 y_set = false;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
125 else
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
126 error ("plot: no data to plot");
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
127 endif
5116
67320fb4ae5c [project @ 2005-01-25 03:57:01 by jwe]
jwe
parents: 5115
diff changeset
128 elseif (x_set)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
129 if (y_set)
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
130 options = __pltopt__ (caller, {""});
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
131 tmp = __plt2__ (h, x, y, options, properties);
12339
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
132 [hlgnd, tlgnd, setlgnd] = __plt_key__ (tmp, options, hlgnd, tlgnd, setlgnd);
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
133 retval = [retval; tmp];
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
134 x = next_arg;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
135 y_set = false;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
136 properties = {};
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
137 else
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
138 y = next_arg;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
139 y_set = true;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
140 endif
5116
67320fb4ae5c [project @ 2005-01-25 03:57:01 by jwe]
jwe
parents: 5115
diff changeset
141 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
142 x = next_arg;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10135
diff changeset
143 x_set = true;
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
144 endif
934
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
145
5118
ecbb290ba9ff [project @ 2005-01-25 22:10:26 by jwe]
jwe
parents: 5117
diff changeset
146 endwhile
934
be867ddbe4aa [project @ 1994-11-17 04:23:41 by jwe]
jwe
parents: 904
diff changeset
147
12339
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
148 if (setlgnd)
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14431
diff changeset
149 legend (gca (), hlgnd, tlgnd);
10995
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
150 endif
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
151 else
10730
390d93e20531 Plot commands now print usage information without errors
Rik <octave@nomad.inbox5.com>
parents: 10679
diff changeset
152 error ("__plt__: invalid number of arguments");
4
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
153 endif
b4df021f796c [project @ 1993-08-08 01:26:08 by jwe]
jwe
parents:
diff changeset
154
6004
01556febbaaf [project @ 2006-09-26 21:16:52 by jwe]
jwe
parents: 5958
diff changeset
155 endfunction
10995
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
156
12339
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
157 function [hlgnd, tlgnd, setlgnd] = __plt_key__ (h, options, hlgnd, tlgnd, setlgnd)
10995
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
158 n = numel (h);
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
159 if (numel (options) == 1)
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
160 options = repmat (options(:), n, 1);
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
161 endif
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
162
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
163 for i = 1 : n
17273
53f1d5bb58bc __plt__.m: Fix legend when plotting vector against matrix (bug #39542)
Falk Tannhäuser <falk.tannhauser@free.fr>
parents: 17184
diff changeset
164 key = options(i).key;
10995
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
165 if (! isempty (key))
11462
aed2c50c3082 legend.m: legend with more than two inline keys (bug 31991). Add/modifyy demos.
Ben Abbott <bpabbott@mac.com>
parents: 11421
diff changeset
166 hlgnd = [hlgnd(:); h(i)];
10995
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
167 tlgnd = {tlgnd{:}, key};
12339
eda5eabd5d0b Fix for inline legends (#32022, #32343)
David Bateman <dbateman@free.fr>
parents: 11523
diff changeset
168 setlgnd = true;
10995
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
169 endif
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
170 endfor
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
171 endfunction
e81914f3921f Update legend code to support fltk (fixes #29348 and partially fixes #30461)
David Bateman <dbateman@free.fr>
parents: 10730
diff changeset
172
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
173 function retval = __plt1__ (h, x1, options, properties = {})
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
174
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
175 if (nargin < 3 || isempty (options))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
176 options = __default_plot_options__ ();
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
177 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
178
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
179 if (! isstruct (options))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
180 error ("__plt1__: options must be a struct array");
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
181 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
182
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
183 [nr, nc] = size (x1);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
184 if (nr == 1)
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
185 x1 = x1.';
14431
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
186 [nr, nc] = deal (nc, nr); # Swap rows and columns
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
187 endif
14431
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
188 if (iscomplex (x1))
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
189 x1_i = imag (x1);
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
190 if (any ((x1_i(:))))
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
191 x2 = x1_i;
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
192 x1 = real (x1);
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
193 else
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
194 x2 = x1;
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
195 x1 = (1:nr)';
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
196 endif
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
197 else
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
198 x2 = x1;
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
199 x1 = (1:nr)';
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
200 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
201
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
202 retval = __plt2__ (h, x1, x2, options, properties);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
203
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
204 endfunction
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
205
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
206 function retval = __plt2__ (h, x1, x2, options, properties = {})
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
207
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
208 if (nargin < 4 || isempty (options))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
209 options = __default_plot_options__ ();
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
210 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
211
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
212 if (! isstruct (options))
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
213 error ("__plt2__: options must be a struct array");
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
214 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
215
14431
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
216 if (islogical (x1))
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
217 x1 = int8 (x1);
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
218 elseif (iscomplex ((x1)))
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
219 x1 = real (x1);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
220 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
221
14431
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
222 if (islogical (x2))
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
223 x2 = int8 (x2);
f22a9555aa69 Fix 2D plotting of boolean values (bug #33607)
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
224 elseif (iscomplex (x2))
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
225 x2 = real (x2);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
226 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
227
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
228 h_set = false;
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
229 if (isempty (x1) && isempty (x2))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
230 retval = zeros (0, 1);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
231 elseif (isscalar (x1))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
232 if (isscalar (x2))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
233 retval = __plt2ss__ (h, x1, x2, options, properties);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
234 elseif (isvector (x2))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
235 retval = __plt2sv__ (h, x1, x2, options, properties);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
236 else
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
237 error ("__plt2__: invalid data for plotting");
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
238 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
239 elseif (isvector (x1))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
240 if (isscalar (x2))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
241 retval = __plt2vs__ (h, x1, x2, options, properties);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
242 elseif (isvector (x2))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
243 retval = __plt2vv__ (h, x1, x2, options, properties);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
244 elseif (ismatrix (x2))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
245 retval = __plt2vm__ (h, x1, x2, options, properties);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
246 else
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
247 error ("__plt2__: invalid data for plotting");
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
248 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
249 elseif (ismatrix (x1))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
250 if (isvector (x2))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
251 retval = __plt2mv__ (h, x1, x2, options, properties);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
252 elseif (ismatrix (x2))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
253 retval = __plt2mm__ (h, x1, x2, options, properties);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
254 else
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
255 error ("__plt2__: invalid data for plotting");
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
256 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
257 else
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
258 error ("__plt2__: invalid data for plotting");
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
259 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
260
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
261 endfunction
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
262
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
263 function retval = __plt2mm__ (h, x, y, options, properties = {})
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
264
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
265 if (nargin < 4 || isempty (options))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
266 options = __default_plot_options__ ();
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
267 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
268
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
269 [x_nr, x_nc] = size (x);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
270 [y_nr, y_nc] = size (y);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
271
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
272 if (x_nr != y_nr && x_nc != y_nc)
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
273 error ("__plt2mm__: matrix dimensions must match");
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
274 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
275
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
276 if (numel (options) == 1)
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
277 options = repmat (options(:), x_nc, 1);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
278 endif
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
279 retval = zeros (x_nc, 1);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
280 for i = 1:x_nc
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
281 linestyle = options(i).linestyle;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
282 marker = options(i).marker;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
283 if (isempty (marker) && isempty (linestyle))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
284 [linestyle, marker] = __next_line_style__ ();
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
285 endif
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
286 color = options(i).color;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
287 if (isempty (color))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
288 color = __next_line_color__ ();
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
289 endif
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
290
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
291 retval(i) = line (x(:,i), y(:,i), "color", color,
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
292 "linestyle", linestyle,
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
293 "marker", marker, properties{:});
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
294 endfor
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
295
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
296 endfunction
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
297
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
298 function retval = __plt2mv__ (h, x, y, options, properties = {})
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
299
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
300 if (nargin < 4 || isempty (options))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
301 options = __default_plot_options__ ();
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
302 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
303
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
304 y = y(:);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
305 [y_nr, y_nc] = size (y);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
306 [x_nr, x_nc] = size (x);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
307
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
308 if (x_nr == y_nr)
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
309 ## Correctly oriented. Do nothing.
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
310 elseif (x_nc == y_nr)
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
311 x = x.';
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
312 [x_nr, x_nc] = deal (x_nc, x_nr);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
313 else
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
314 error ("__plt2mv__: matrix dimensions must match");
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
315 endif
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
316
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
317 if (numel (options) == 1)
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
318 options = repmat (options(:), x_nc, 1);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
319 endif
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
320 retval = zeros (x_nc, 1);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
321 for i = 1:x_nc
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
322 linestyle = options(i).linestyle;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
323 marker = options(i).marker;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
324 if (isempty (marker) && isempty (linestyle))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
325 [linestyle, marker] = __next_line_style__ ();
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
326 endif
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
327 color = options(i).color;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
328 if (isempty (color))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
329 color = __next_line_color__ ();
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
330 endif
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
331
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
332 retval(i) = line (x(:,i), y, "color", color,
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
333 "linestyle", linestyle,
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
334 "marker", marker, properties{:});
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
335 endfor
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
336
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
337 endfunction
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
338
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
339 function retval = __plt2ss__ (h, x, y, options, properties = {})
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
340
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
341 if (nargin < 4 || isempty (options))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
342 options = __default_plot_options__ ();
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
343 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
344
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
345 if (numel (options) > 1)
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
346 options = options(1);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
347 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
348
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
349 linestyle = options.linestyle;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
350 marker = options.marker;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
351 if (isempty (marker) && isempty (linestyle))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
352 ## If unspecified, marker for a single point is always "."
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
353 linestyle = "-";
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
354 marker = ".";
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
355 endif
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
356 color = options.color;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
357 if (isempty (color))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
358 color = __next_line_color__ ();
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
359 endif
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
360
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
361 retval = line (x, y, "color", color,
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
362 "linestyle", linestyle,
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
363 "marker", marker, properties{:});
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
364
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
365 endfunction
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
366
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
367 function retval = __plt2sv__ (h, x, y, options, properties = {})
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
368
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
369 if (nargin < 4 || isempty (options))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
370 options = __default_plot_options__ ();
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
371 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
372
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
373 len = numel (y);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
374 if (numel (options) == 1)
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
375 options = repmat (options(:), len, 1);
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
376 endif
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
377 retval = zeros (len, 1);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
378 for i = 1:len
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
379 linestyle = options(i).linestyle;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
380 marker = options(i).marker;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
381 if (isempty (marker) && isempty (linestyle))
16889
76bd90f6ba65 __plt__.m: Use marker style '.' for vector/scalar plots (bug #38825).
Rik <rik@octave.org>
parents: 16869
diff changeset
382 ## If unspecified, marker for a point is always "."
76bd90f6ba65 __plt__.m: Use marker style '.' for vector/scalar plots (bug #38825).
Rik <rik@octave.org>
parents: 16869
diff changeset
383 linestyle = "-";
76bd90f6ba65 __plt__.m: Use marker style '.' for vector/scalar plots (bug #38825).
Rik <rik@octave.org>
parents: 16869
diff changeset
384 marker = ".";
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
385 endif
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
386 color = options(i).color;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
387 if (isempty (color))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
388 color = __next_line_color__ ();
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
389 endif
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
390
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
391 retval(i) = line (x, y(i), "color", color,
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
392 "linestyle", linestyle,
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
393 "marker", marker, properties{:});
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
394 endfor
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
395
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
396 endfunction
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
397
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
398 function retval = __plt2vm__ (h, x, y, options, properties = {})
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
399
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
400 if (nargin < 4 || isempty (options))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
401 options = __default_plot_options__ ();
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
402 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
403
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
404 x = x(:);
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
405 [x_nr, x_nc] = size (x);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
406 [y_nr, y_nc] = size (y);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
407
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
408 if (x_nr == y_nr)
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
409 ## Correctly oriented. Do nothing.
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
410 elseif (x_nr == y_nc)
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
411 y = y.';
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
412 [y_nr, y_nc] = deal (y_nc, y_nr);
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
413 else
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
414 error ("__plt2vm__: matrix dimensions must match");
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
415 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
416
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
417 if (numel (options) == 1)
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
418 options = repmat (options(:), y_nc, 1);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
419 endif
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
420 retval = zeros (y_nc, 1);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
421 for i = 1:y_nc
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
422 linestyle = options(i).linestyle;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
423 marker = options(i).marker;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
424 if (isempty (marker) && isempty (linestyle))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
425 [linestyle, marker] = __next_line_style__ ();
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
426 endif
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
427 color = options(i).color;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
428 if (isempty (color))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
429 color = __next_line_color__ ();
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
430 endif
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
431
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
432 retval(i) = line (x, y(:,i), "color", color,
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
433 "linestyle", linestyle,
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
434 "marker", marker, properties{:});
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
435 endfor
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
436
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
437 endfunction
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
438
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
439 function retval = __plt2vs__ (h, x, y, options, properties = {})
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
440
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
441 if (nargin < 4 || isempty (options))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
442 options = __default_plot_options__ ();
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
443 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
444
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
445 len = numel (x);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
446 if (numel (options) == 1)
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
447 options = repmat (options(:), len, 1);
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
448 endif
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
449 retval = zeros (len, 1);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
450 for i = 1:len
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
451 linestyle = options(i).linestyle;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
452 marker = options(i).marker;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
453 if (isempty (marker) && isempty (linestyle))
16889
76bd90f6ba65 __plt__.m: Use marker style '.' for vector/scalar plots (bug #38825).
Rik <rik@octave.org>
parents: 16869
diff changeset
454 ## If unspecified, marker for a point is always "."
76bd90f6ba65 __plt__.m: Use marker style '.' for vector/scalar plots (bug #38825).
Rik <rik@octave.org>
parents: 16869
diff changeset
455 linestyle = "-";
76bd90f6ba65 __plt__.m: Use marker style '.' for vector/scalar plots (bug #38825).
Rik <rik@octave.org>
parents: 16869
diff changeset
456 marker = ".";
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
457 endif
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
458 color = options(i).color;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
459 if (isempty (color))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
460 color = __next_line_color__ ();
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
461 endif
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
462
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
463 retval(i) = line (x(i), y, "color", color,
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
464 "linestyle", linestyle,
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
465 "marker", marker, properties{:});
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
466 endfor
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
467
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
468 endfunction
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
469
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
470 function retval = __plt2vv__ (h, x, y, options, properties = {})
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
471
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
472 if (nargin < 4 || isempty (options))
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
473 options = __default_plot_options__ ();
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
474 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
475
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
476 if (numel (options) > 1)
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
477 options = options(1);
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
478 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
479
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
480 x = x(:);
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
481 y = y(:);
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
482
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
483 if (length (x) != length (y))
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
484 error ("__plt2vv__: vector lengths must match");
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
485 endif
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
486
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
487 linestyle = options.linestyle;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
488 marker = options.marker;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
489 if (isempty (marker) && isempty (linestyle))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
490 [linestyle, marker] = __next_line_style__ ();
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
491 endif
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
492 color = options.color;
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
493 if (isempty (color))
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
494 color = __next_line_color__ ();
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
495 endif
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
496
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
497 retval = line (x, y, "color", color,
17439
1dfc3abb0f0d __plt__.m: Indent block of code to match others.
Rik <rik@octave.org>
parents: 17396
diff changeset
498 "linestyle", linestyle,
1dfc3abb0f0d __plt__.m: Indent block of code to match others.
Rik <rik@octave.org>
parents: 17396
diff changeset
499 "marker", marker, properties{:});
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
500
9896
1aeb39118764 convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
501 endfunction
16869
11dee6ef204c __plt__.m: Eliminate unneeded input validation from leaf functions.
Rik <rik@octave.org>
parents: 16857
diff changeset
502