Changeset 18481
- Timestamp:
- 09/03/14 19:29:49 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/qmu/plot/plot_hist_norm.m
r14182 r18481 44 44 % ymin2 (numeric, minimum of cdf y-axis) 45 45 % ymax2 (numeric, maximum of cdf y-axis) 46 % nrmplt (char, 'line' or 'off' to change nrm plots from 'bar') 46 % nrmplt (char, pass 'l' or 'off' to change nrm plots 47 % from default of 'bar' or 'b' to 'line' instead, 48 % pass 's' to change nrm plot to 'stairs') 47 49 % cdfplt (char, 'off' to turn off cdf line plots) 48 50 % cdfleg (char, 'off' to turn off cdf legends) … … 174 176 175 177 % parameters 176 178 LineWidth=1; 177 179 while (iarg <= nargin-1) 178 180 if ischar(varargin{iarg}) … … 180 182 {'hmin','hmax','hnint',... 181 183 'ymin1','ymax1','ymin2','ymax2',... 182 'nrmplt','EdgeColor','FaceColor','cdfplt','cdfleg','nrmleg','cmap','titleplt','xlabelplt','ylabelplt','FontSize'},... 184 'nrmplt','EdgeColor','FaceColor','LineWidth','cdfplt',... 185 'cdfleg','nrmleg','cmap','titleplt','xlabelplt','ylabelplt','FontSize'},... 183 186 'exact')) 184 187 eval([varargin{iarg} '=varargin{iarg+1};']); … … 251 254 hl1(1*ncol+1:2*ncol)=... 252 255 line(edges(1:end-1),dhistc(1:end-1,1*ncol+1:2*ncol),... 253 'LineWidth',2); 256 'LineWidth',LineWidth); 257 elseif strncmpi(nrmplt,'s',1) 258 hl1=stairs(edges(1:end-1)-(hmax-hmin)/hnint/2,dhistc(1:end-1,1:ncol)); 254 259 elseif strncmpi(nrmplt,'off',3) 255 260 hl1=bar (edges(1:end-1),dhistc(1:end-1,1:1*ncol)); … … 269 274 270 275 %set face and edge color 271 for i=1:length(hl1) 272 set(hl1(i),'EdgeColor',EdgeColor,'FaceColor',FaceColor); 276 if ~strncmpi(nrmplt,'s',1) 277 for i=1:length(hl1) 278 set(hl1(i),'EdgeColor',EdgeColor,'FaceColor',FaceColor,'LineWidth',LineWidth); 279 end 273 280 end 274 281 … … 282 289 cmap=colormap; 283 290 for i=1:length(hl1) 284 if (length(hl1) > 1) 285 imap=round((i-1)/(length(hl1)-1)*(size(cmap,1)-1))+1; 286 else 287 imap=1; 288 end 289 if strcmpi(get(hl1(i),'Type'),'hggroup') 290 if ischar(get(hl1(i),'FaceColor')) && ... 291 strcmpi(get(hl1(i),'FaceColor'),'flat') 292 set(hl1(i),'FaceColor',cmap(imap,:)) 293 else 294 set(hl1(i),'FaceColor',get(hl1(i),'FaceColor')) 295 end 296 elseif strcmpi(get(hl1(i),'Type'),'line') 297 set(hl1(i),'Color',cmap(imap,:)) 298 end 291 if (length(hl1) > 1) 292 imap=round((i-1)/(length(hl1)-1)*(size(cmap,1)-1))+1; 293 else 294 imap=1; 295 end 296 if ~strncmpi(nrmplt,'s',1) && strcmpi(get(hl1(i),'Type'),'hggroup') 297 if ischar(get(hl1(i),'FaceColor')) && ... 298 strcmpi(get(hl1(i),'FaceColor'),'flat') 299 set(hl1(i),'FaceColor',cmap(imap,:)) 300 else 301 set(hl1(i),'FaceColor',get(hl1(i),'FaceColor')) 302 end 303 elseif strcmpi(get(hl1(i),'Type'),'line') 304 set(hl1(i),'Color',cmap(imap,:)) 305 elseif strncmpi(nrmplt,'s',1) 306 set(hl1(i),'Color',EdgeColor,'LineWidth',2) 307 end 299 308 end 300 309
Note:
See TracChangeset
for help on using the changeset viewer.