1
- classdef legtools
1
+ classdef ( Abstract ) legtools
2
2
% LEGTOOLS is a MATLAB class definition providing the user with a set of
3
3
% methods to modify existing Legend objects.
4
4
%
5
5
% This is an HG2 specific implementation and requires MATLAB R2014b or
6
6
% newer.
7
7
%
8
8
% legtools methods:
9
- % append - Add one or more entries to the end of the legend
10
- % permute - Rearrange the legend entries
11
- % remove - Remove one or more legend entries
12
- % adddummy - Add one or more entries to the legend for unsupported graphics objects
9
+ % append - Add one or more entries to the end of the legend
10
+ % permute - Rearrange the legend entries
11
+ % remove - Remove one or more legend entries
12
+ % adddummy - Add one or more entries to the legend for unsupported graphics objects
13
13
%
14
14
% See also legend
15
15
16
- methods
17
- function obj = legtools
18
- % Dummy constructor so we don't return an empty class instance
19
- clear obj
20
- end
21
- end
22
-
23
16
methods (Static )
24
17
function append(lh , newStrings )
25
18
% APPEND appends strings, newStrings, to the specified Legend
@@ -143,8 +136,6 @@ function remove(lh, remidx)
143
136
);
144
137
end
145
138
146
-
147
-
148
139
if numel(unique(remidx )) == numel(lh .String )
149
140
delete(lh );
150
141
warning(' legtools:remove:LegendDeleted' , ...
@@ -219,8 +210,6 @@ function adddummy(lh, newStrings, plotParams)
219
210
end
220
211
end
221
212
222
- % TODO: More plotParams error checking
223
-
224
213
parentaxes = lh .PlotChildren(1 ).Parent;
225
214
226
215
washeld = ishold(parentaxes ); % Set a flag for previous hold state ofthe parent axes
@@ -242,7 +231,7 @@ function adddummy(lh, newStrings, plotParams)
242
231
methods (Static , Access = private )
243
232
function verchk()
244
233
% Throw error if we're not using R2014b or newer
245
- if verLessThan(' matlab' ,' 8.4' )
234
+ if verLessThan(' matlab' , ' 8.4' )
246
235
error(' legtools:UnsupportedMATLABver' , ...
247
236
' MATLAB releases prior to R2014b are not supported' ...
248
237
);
@@ -293,13 +282,13 @@ function verchk()
293
282
% out our error
294
283
error(msgID , ...
295
284
' Invalid Data Type Passed: %s\n\n Data must be of type: ''%s'' , ''%s'' , or ''%s'' ' , ...
296
- class(newString ), class(cell(1 )), class(char( ' ' )) , class(string( ' ' ) ) ...
285
+ class(newString ), class(cell(1 )), class(' ' ), class(" " ) ...
297
286
);
298
287
else
299
288
% Error message for MATLAB versions older than R2016b
300
289
error(msgID , ...
301
290
' Invalid Data Type Passed: %s\n\n Data must be of type: ''%s'' or ''%s'' ' , ...
302
- class(newString ), class(cell(1 )), class(char( ' ' ) ) ...
291
+ class(newString ), class(cell(1 )), class(' ' ) ...
303
292
);
304
293
end
305
294
end
0 commit comments