Mercurial > octave-nkf
annotate scripts/plot/private/__plt__.m @ 10549:95c3e38098bf
Untabify .m scripts
author | Rik <code@nomad.inbox5.com> |
---|---|
date | Fri, 23 Apr 2010 11:28:50 -0700 |
parents | 4516a0c97ced |
children | ca6d8a38d298 |
rev | line source |
---|---|
7017 | 1 ## Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002, 2004, |
8920 | 2 ## 2005, 2006, 2007, 2009 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/>. | |
245 | 19 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
20 ## -*- texinfo -*- |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
21 ## @deftypefn {Function File} {} __plt__ (@var{caller}, @var{h}, @var{varargin}) |
6895 | 22 ## Undocumented internal function. |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
23 ## @end deftypefn |
3402 | 24 |
2314 | 25 ## Author: jwe |
26 | |
6302 | 27 function retval = __plt__ (caller, h, varargin) |
5406 | 28 |
6257 | 29 nargs = nargin - 2; |
6146 | 30 |
6257 | 31 if (nargs > 0) |
934 | 32 |
5116 | 33 k = 1; |
5119 | 34 |
35 x_set = false; | |
36 y_set = false; | |
6459 | 37 property_set = false; |
38 properties = {}; | |
934 | 39 |
5116 | 40 ## Gather arguments, decode format, gather plot strings, and plot lines. |
934 | 41 |
6405 | 42 retval = []; |
43 | |
6257 | 44 while (nargs > 0 || x_set) |
5115 | 45 |
5119 | 46 if (nargs == 0) |
10549 | 47 ## Force the last plot when input variables run out. |
48 next_cell = {}; | |
49 next_arg = {""}; | |
5118 | 50 else |
10549 | 51 next_cell = varargin(k); |
52 next_arg = varargin{k++}; | |
5116 | 53 endif |
934 | 54 |
6257 | 55 nargs--; |
56 | |
6146 | 57 if (ischar (next_arg) || iscellstr (next_arg)) |
10549 | 58 if (x_set) |
59 [options, valid] = __pltopt__ (caller, next_arg, false); | |
60 if (! valid) | |
61 if (nargs == 0) | |
62 error ("%s: properties must appear followed by a value", caller); | |
63 endif | |
64 properties = [properties, [next_cell, varargin(k++)]]; | |
65 nargs--; | |
66 continue; | |
67 else | |
68 while (nargs > 0 && ischar (varargin{k})) | |
69 if (nargs < 2) | |
70 error ("%s: properties must appear followed by a value", | |
71 caller); | |
72 endif | |
73 properties = [properties, varargin(k:k+1)]; | |
74 k += 2; | |
75 nargs -= 2; | |
76 endwhile | |
77 endif | |
78 if (y_set) | |
79 tmp = __plt2__ (h, x, y, options, properties); | |
80 properties = {}; | |
81 retval = [retval; tmp]; | |
82 else | |
83 tmp = __plt1__ (h, x, options, properties); | |
84 properties = {}; | |
85 retval = [retval; tmp]; | |
86 endif | |
87 x_set = false; | |
88 y_set = false; | |
89 else | |
90 error ("plot: no data to plot"); | |
91 endif | |
5116 | 92 elseif (x_set) |
10549 | 93 if (y_set) |
94 options = __pltopt__ (caller, {""}); | |
95 tmp = __plt2__ (h, x, y, options, properties); | |
96 retval = [retval; tmp]; | |
97 x = next_arg; | |
98 y_set = false; | |
99 properties = {}; | |
100 else | |
101 y = next_arg; | |
102 y_set = true; | |
103 endif | |
5116 | 104 else |
10549 | 105 x = next_arg; |
106 x_set = true; | |
4 | 107 endif |
934 | 108 |
5118 | 109 endwhile |
934 | 110 |
4 | 111 else |
5119 | 112 msg = sprintf ("%s (y)\n", caller); |
113 msg = sprintf ("%s %s (x, y, ...)\n", msg, caller); | |
114 msg = sprintf ("%s %s (x, y, fmt, ...)", msg, caller); | |
6459 | 115 msg = sprintf ("%s %s (x, y, property, value, ...)", msg, caller); |
934 | 116 usage (msg); |
4 | 117 endif |
118 | |
6004 | 119 endfunction |
6459 | 120 |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
121 function retval = __plt1__ (h, x1, options, properties) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
122 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
123 if (nargin < 2 || nargin > 4) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
124 print_usage (); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
125 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
126 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
127 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
|
128 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
|
129 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
130 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
131 if (nargin < 4) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
132 properties = {}; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
133 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
134 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
135 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
|
136 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
|
137 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
138 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
139 [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
|
140 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
|
141 x1 = x1.'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
142 tmp = nr; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
143 nr = nc; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
144 nc = tmp; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
145 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
146 x1_i = imag (x1); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
147 if (any (any (x1_i))) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
148 x2 = x1_i; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
149 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
|
150 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
151 x2 = x1; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
152 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
|
153 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
154 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
155 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
|
156 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
157 endfunction |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
158 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
159 function 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
|
160 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
161 if (nargin < 3 || nargin > 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
162 print_usage (); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
163 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
164 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
165 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
|
166 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
|
167 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
168 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
169 if (nargin < 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
170 properties = {}; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
171 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
172 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
173 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
|
174 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
|
175 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
176 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
177 if (any (any (imag (x1)))) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
178 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
|
179 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
180 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
181 if (any (any (imag (x2)))) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
182 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
|
183 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
184 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
185 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
|
186 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
|
187 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
|
188 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
|
189 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
|
190 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
|
191 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
|
192 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
|
193 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
194 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
|
195 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
196 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
|
197 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
|
198 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
|
199 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
|
200 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
|
201 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
|
202 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
|
203 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
204 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
|
205 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
206 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
|
207 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
|
208 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
|
209 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
|
210 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
|
211 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
212 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
|
213 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
214 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
215 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
|
216 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
217 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
218 endfunction |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
219 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
220 function retval = __plt2mm__ (h, x, y, options, properties) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
221 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
222 if (nargin < 3 || nargin > 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
223 print_usage (); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
224 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
225 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
226 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
|
227 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
|
228 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
229 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
230 if (nargin < 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
231 properties = {}; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
232 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
233 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
234 [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
|
235 [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
|
236 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
237 k = 1; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
238 if (x_nr == y_nr && x_nc == y_nc) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
239 if (x_nc > 0) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
240 if (numel (options) == 1) |
10549 | 241 options = repmat (options(:), x_nc, 1); |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
242 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
243 retval = zeros (x_nc, 1); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
244 for i = 1:x_nc |
10549 | 245 tkey = options(i).key; |
246 if (! isempty (tkey)) | |
247 set (h, "key", "on"); | |
248 endif | |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
249 linestyle = options(i).linestyle; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
250 marker = options(i).marker; |
10549 | 251 if (isempty (marker) && isempty (linestyle)) |
252 [linestyle, marker] = __next_line_style__ (); | |
253 endif | |
254 color = options(i).color; | |
255 if (isempty (color)) | |
256 color = __next_line_color__ (); | |
257 endif | |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
258 |
10549 | 259 retval(i) = line (x(:,i), y(:,i), "keylabel", tkey, "color", color, |
260 "linestyle", linestyle, | |
261 "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
|
262 endfor |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
263 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
264 error ("__plt2mm__: arguments must be a matrices"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
265 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
266 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
267 error ("__plt2mm__: 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
|
268 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
269 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
270 endfunction |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
271 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
272 function retval = __plt2mv__ (h, x, y, options, properties) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
273 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
274 if (nargin < 3 || nargin > 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
275 print_usage (); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
276 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
277 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
278 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
|
279 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
|
280 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
281 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
282 if (nargin < 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
283 properties = {}; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
284 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
285 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
286 [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
|
287 [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
|
288 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
289 if (y_nr == 1) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
290 y = y'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
291 tmp = y_nr; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
292 y_nr = y_nc; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
293 y_nc = tmp; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
294 endif |
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 if (x_nr == y_nr) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
297 1; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
298 elseif (x_nc == y_nr) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
299 x = x'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
300 tmp = x_nr; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
301 x_nr = x_nc; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
302 x_nc = tmp; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
303 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
304 error ("__plt2mv__: 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
|
305 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
306 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
307 if (x_nc > 0) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
308 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
|
309 options = repmat (options(:), x_nc, 1); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
310 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
311 retval = zeros (x_nc, 1); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
312 for i = 1:x_nc |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
313 tkey = options(i).key; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
314 if (! isempty (tkey)) |
10549 | 315 set (h, "key", "on"); |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
316 endif |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
317 linestyle = options(i).linestyle; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
318 marker = options(i).marker; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
319 if (isempty (marker) && isempty (linestyle)) |
10549 | 320 [linestyle, marker] = __next_line_style__ (); |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
321 endif |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
322 color = options(i).color; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
323 if (isempty (color)) |
10549 | 324 color = __next_line_color__ (); |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
325 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
326 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
327 retval(i) = line (x(:,i), y, "keylabel", tkey, "color", color, |
10549 | 328 "linestyle", linestyle, |
329 "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
|
330 endfor |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
331 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
332 error ("__plt2mv__: arguments must be a matrices"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
333 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
334 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
335 endfunction |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
336 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
337 function retval = __plt2ss__ (h, x, y, options, properties) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
338 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
339 if (nargin < 3 || nargin > 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
340 print_usage (); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
341 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
342 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
343 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
|
344 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
|
345 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
346 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
347 if (nargin < 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
348 properties = {}; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
349 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
350 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
351 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
|
352 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
|
353 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
354 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
355 [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
|
356 [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
|
357 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
358 if (x_nr == 1 && x_nr == y_nr && x_nc == 1 && x_nc == y_nc) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
359 key = options.key; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
360 if (! isempty (key)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
361 set (h, "key", "on"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
362 endif |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
363 linestyle = options.linestyle; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
364 marker = options.marker; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
365 if (isempty (marker) && isempty (linestyle)) |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
366 [linestyle, marker] = __next_line_style__ (); |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
367 endif |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
368 color = options.color; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
369 if (isempty (color)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
370 color = __next_line_color__ (); |
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 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
373 retval = line (x, y, "keylabel", key, "color", color, |
10549 | 374 "linestyle", linestyle, |
375 "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
|
376 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
377 error ("__plt2ss__: arguments must be scalars"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
378 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
379 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
380 endfunction |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
381 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
382 function retval = __plt2sv__ (h, x, y, options, properties) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
383 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
384 if (nargin < 3 || nargin > 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
385 print_usage (); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
386 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
387 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
388 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
|
389 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
|
390 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
391 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
392 if (nargin < 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
393 properties = {}; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
394 endif |
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 if (isscalar (x) && isvector (y)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
397 len = numel (y); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
398 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
|
399 options = repmat (options(:), len, 1); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
400 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
401 retval = zeros (len, 1); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
402 for i = 1:len |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
403 tkey = options(i).key; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
404 if (! isempty (tkey)) |
10549 | 405 set (h, "key", "on"); |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
406 endif |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
407 linestyle = options(i).linestyle; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
408 marker = options(i).marker; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
409 if (isempty (marker) && isempty (linestyle)) |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
410 [linestyle, marker] = __next_line_style__ (); |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
411 endif |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
412 color = options(i).color; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
413 if (isempty (color)) |
10549 | 414 color = __next_line_color__ (); |
9896
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 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
417 retval(i) = line (x, y(i), "keylabel", tkey, "color", color, |
10549 | 418 "linestyle", linestyle, |
419 "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
|
420 endfor |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
421 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
422 error ("__plt2sv__: first arg must be scalar, second arg must be vector"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
423 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
424 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
425 endfunction |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
426 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
427 function retval = __plt2vm__ (h, x, y, options, properties) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
428 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
429 if (nargin < 3 || nargin > 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
430 print_usage (); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
431 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
432 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
433 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
|
434 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
|
435 endif |
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 if (nargin < 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
438 properties = {}; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
439 endif |
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 [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
|
442 [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
|
443 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
444 if (x_nr == 1) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
445 x = x'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
446 tmp = x_nr; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
447 x_nr = x_nc; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
448 x_nc = tmp; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
449 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
450 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
451 if (x_nr == y_nr) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
452 1; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
453 elseif (x_nr == y_nc) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
454 y = y'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
455 tmp = y_nr; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
456 y_nr = y_nc; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
457 y_nc = tmp; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
458 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
459 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
|
460 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
461 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
462 if (y_nc > 0) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
463 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
|
464 options = repmat (options(:), y_nc, 1); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
465 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
466 retval = zeros (y_nc, 1); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
467 for i = 1:y_nc |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
468 tkey = options(i).key; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
469 if (! isempty (tkey)) |
10549 | 470 set (h, "key", "on"); |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
471 endif |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
472 linestyle = options(i).linestyle; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
473 marker = options(i).marker; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
474 if (isempty (marker) && isempty (linestyle)) |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
475 [linestyle, marker] = __next_line_style__ (); |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
476 endif |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
477 color = options(i).color; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
478 if (isempty (color)) |
10549 | 479 color = __next_line_color__ (); |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
480 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
481 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
482 retval(i) = line (x, y(:,i), "keylabel", tkey, "color", color, |
10549 | 483 "linestyle", linestyle, |
484 "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
|
485 endfor |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
486 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
487 error ("__plt2vm__: arguments must be a matrices"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
488 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
489 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
490 endfunction |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
491 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
492 function retval = __plt2vs__ (h, x, y, options, properties) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
493 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
494 if (nargin < 3 || nargin > 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
495 print_usage (); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
496 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
497 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
498 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
|
499 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
|
500 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
501 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
502 if (nargin < 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
503 properties = {}; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
504 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
505 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
506 if (isvector (x) && isscalar (y)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
507 len = numel (x); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
508 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
|
509 options = repmat (options(:), len, 1); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
510 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
511 retval = zeros (len, 1); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
512 for i = 1:len |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
513 tkey = options(i).key; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
514 if (! isempty (tkey)) |
10549 | 515 set (h, "key", "on"); |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
516 endif |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
517 linestyle = options(i).linestyle; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
518 marker = options(i).marker; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
519 if (isempty (marker) && isempty (linestyle)) |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
520 [linestyle, marker] = __next_line_style__ (); |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
521 endif |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
522 color = options(i).color; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
523 if (isempty (color)) |
10549 | 524 color = __next_line_color__ (); |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
525 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
526 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
527 retval(i) = line (x(i), y, "keylabel", tkey, "color", color, |
10549 | 528 "linestyle", linestyle, |
529 "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
|
530 endfor |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
531 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
532 error ("__plt2vs__: first arg must be vector, second arg must be scalar"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
533 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
534 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
535 endfunction |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
536 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
537 function retval = __plt2vv__ (h, x, y, options, properties) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
538 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
539 if (nargin < 3 || nargin > 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
540 print_usage (); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
541 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
542 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
543 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
|
544 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
|
545 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
546 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
547 if (nargin < 5) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
548 properties = {}; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
549 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
550 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
551 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
|
552 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
|
553 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
554 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
555 [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
|
556 [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
|
557 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
558 if (x_nr == 1) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
559 x = x'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
560 tmp = x_nr; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
561 x_nr = x_nc; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
562 x_nc = tmp; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
563 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
564 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
565 if (y_nr == 1) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
566 y = y'; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
567 tmp = y_nr; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
568 y_nr = y_nc; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
569 y_nc = tmp; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
570 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
571 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
572 if (x_nr == y_nr) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
573 key = options.key; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
574 if (! isempty (key)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
575 set (h, "key", "on"); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
576 endif |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
577 linestyle = options.linestyle; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
578 marker = options.marker; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
579 if (isempty (marker) && isempty (linestyle)) |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
580 [linestyle, marker] = __next_line_style__ (); |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
9896
diff
changeset
|
581 endif |
9896
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
582 color = options.color; |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
583 if (isempty (color)) |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
584 color = __next_line_color__ (); |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
585 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
586 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
587 retval = line (x, y, "keylabel", key, "color", color, |
10549 | 588 "linestyle", linestyle, |
589 "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
|
590 else |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
591 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
|
592 endif |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
593 |
1aeb39118764
convert some plot functions to subfunctions or make some them private
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
594 endfunction |