source:
issm/oecreview/Archive/11881-11894/ISSM-11891-11892.diff@
11991
Last change on this file since 11991 was 11991, checked in by , 13 years ago | |
---|---|
File size: 3.5 KB |
-
proj/ice/larour/issm-uci-clean/trunk-jpl/src/m/classes/plotoptions.m
47 47 error('buildlist error message: an even number of plotoptions is required') 48 48 end 49 49 50 % first: build a pairoptions out of varargin:50 %go through varargin and build list (like pairoptions) 51 51 rawoptions=pairoptions(varargin{:}); 52 numoptions = (nargin-1)/2; 53 rawlist=cell(numoptions,2); 54 for i=1:numoptions, 55 if ischar(varargin{2*i-1}), 56 rawlist{i,1}=varargin{2*i-1}; 57 rawlist{i,2}=varargin{2*i}; 58 else 59 %option is not a string, ignore it 60 disp(['WARNING: option number ' num2str(i) ' is not a string, it will be ignored']); 61 rawlist(i,:)=[]; 62 continue 63 end 64 end 52 65 53 66 %get figure number 54 67 opt.figurenumber=getfieldvalue(rawoptions,'figure',1); … … 71 84 end 72 85 73 86 %process plot options 74 for i=1:size(raw options.list,1),87 for i=1:size(rawlist,1), 75 88 76 89 %If alloptions flag has is on, apply to all plots 77 if (allflag & ~strcmpi(raw options.list{i,1},'data') & ~ismember('#',rawoptions.list{i,1})),90 if (allflag & ~strcmpi(rawlist{i,1},'data') & ~ismember('#',rawlist{i,1})), 78 91 for j=1:numberofplots, 79 opt.list{j}=addfield(opt.list{j},raw options.list{i,1},rawoptions.list{i,2});92 opt.list{j}=addfield(opt.list{j},rawlist{i,1},rawlist{i,2}); 80 93 end 81 94 82 95 %option contains '#' 83 elseif ismember('#',raw options.list{i,1}),96 elseif ismember('#',rawlist{i,1}), 84 97 85 98 %get suplot(s) associated 86 string=strsplit(raw options.list{i,1},'#');99 string=strsplit(rawlist{i,1},'#'); 87 100 plotnums=string{end}; 88 101 field=string{1}; 89 102 … … 101 114 %#all 102 115 elseif strcmpi(plotnum,'all'); 103 116 for j=1:numberofplots, 104 opt.list{j}=addfield(opt.list{j},field,raw options.list{i,2});117 opt.list{j}=addfield(opt.list{j},field,rawlist{i,2}); 105 118 end 106 119 107 120 %#i-j … … 112 125 error(['the option #i-j is not set properly for ' field]); 113 126 end 114 127 for j=nums(1):nums(2), 115 opt.list{j}=addfield(opt.list{j},field,raw options.list{i,2});128 opt.list{j}=addfield(opt.list{j},field,rawlist{i,2}); 116 129 end 117 130 118 131 %#i … … 121 134 if str2num(plotnum)>numberofplots, 122 135 error(['opt error message: ' field ' cannot be assigned (' plotnum ' exceed maximum number of plot)']); 123 136 end 124 opt.list{str2num(plotnum)}=addfield(opt.list{str2num(plotnum)},field,raw options.list{i,2});137 opt.list{str2num(plotnum)}=addfield(opt.list{str2num(plotnum)},field,rawlist{i,2}); 125 138 end 126 139 end 127 140 … … 131 144 %go through all subplot and assign to the first one free 132 145 j=1; 133 146 while (j<=numberofplots), 134 if ~exist(opt.list{j},raw options.list{i,1});135 opt.list{j}=addfield(opt.list{j},raw options.list{i,1},rawoptions.list{i,2});147 if ~exist(opt.list{j},rawlist{i,1}); 148 opt.list{j}=addfield(opt.list{j},rawlist{i,1},rawlist{i,2}); 136 149 break 137 150 else 138 151 j=j+1; 139 152 end 140 153 end 141 154 if j>numberofplots, 142 disp(['plot info message: too many ''' raw options.list{i,1} ''' options']);155 disp(['plot info message: too many ''' rawlist{i,1} ''' options']); 143 156 end 144 157 end 145 158 end
Note:
See TracBrowser
for help on using the repository browser.