-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathm_ungrid.m
41 lines (33 loc) · 863 Bytes
/
m_ungrid.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function m_ungrid(goptn);
% M_UNGRID Removes a grid;
% M_UNGRID deletes a map grid, but leaves any plotted
% data.
%
% M_UNGRID XXX
% or
% M_UNGRID('XXX')
%
% can be used to remove other parameters plotted using an
% M_XXX command (e.g. M_UNGRID COAST).
% Rich Pawlowicz (rich@ocgy.ubc.ca) 4/Apr/97
%
% 14/11/98 - Added possible option to remove other tagged items.
%
% This software is provided "as is" without warranty of any kind. But
% it's mine, so you can't sell it.
if nargin==0,
mstr='m_grid_';
else
mstr=['m_' lower(goptn)];
end;
hh=get(gca,'children');
things=get(hh,'tag');
if length(hh)==1, things={things}; end;
for i=1:length(hh),
if ~isempty(things{i}) & strmatch(mstr,things{i}),
delete(hh(i));
end;
end;
if strmatch('m_grid',mstr),
set(gca,'visible','on');
end;