Changeset 871 for trunk/src/plot_field.m
- Timestamp:
- Feb 16, 2015, 12:15:23 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_field.m
r869 r871 202 202 end 203 203 PlotParamOut.Axes=plot_profile(Data,CellInfo(index_1D),haxes,PlotParamOut.Axes,CheckHold);% 204 if isfield(PlotParamOut,'Vectors') 205 PlotParamOut=rmfield(PlotParamOut,'Vectors'); 206 end 207 if isfield(PlotParamOut,'Scalar') 208 PlotParamOut=rmfield(PlotParamOut,'Scalar'); 209 end 204 210 if testzoomaxes 205 211 [zoomaxes,PlotParamOut.Axes]=plot_profile(Data,CellInfo(index_1D),zoomaxes,PlotParamOut.Axes,CheckHold); … … 216 222 htext=findobj(hfig,'Tag','TableDisplay'); 217 223 hchecktable=findobj(hfig,'Tag','CheckTable'); 218 % if isempty(index_2D) && isempty(index_1D)%text display alone219 % htext=findobj(hfig,'Tag','TableDisplay');220 % else %text display added to plot221 % %htext=findobj(hfig,'Tag','text_display');222 % end223 224 if ~isempty(htext)&&~isempty(hchecktable) 224 225 if isempty(index_0D) 225 set(htext,'Data',{})226 set(htext,'visible','off')227 set(hchecktable,'visible','off')228 set(hchecktable,'Value',0)226 % set(htext,'Data',{}) 227 % set(htext,'visible','off') 228 % set(hchecktable,'visible','off') 229 % set(hchecktable,'Value',0) 229 230 else 230 231 errormsg=plot_text(Data,CellInfo(index_0D),htext); … … 384 385 ColorOrder=[1 0 0;0 1 0;0 0 1;0 0.75 0.75;0.75 0 0.75;0.75 0.75 0;0.25 0.25 0.25]; 385 386 set(hfig,'DefaultAxesColorOrder',ColorOrder) 386 % if isfield(Coordinates,'NextPlot')387 % set(haxes,'NextPlot',Coordinates.NextPlot)388 % end389 387 if CheckHold 390 388 set(haxes,'NextPlot','add') … … 395 393 %% prepare the string for plot command 396 394 plotstr='hhh=plot('; 397 % coord_x_index=[];398 395 xtitle=''; 399 396 ytitle=''; … … 403 400 MinY_cell=[]; 404 401 MaxY_cell=[]; 402 testplot=ones(size(data.ListVarName));%default test for plotted variables 405 403 %loop on input fields 406 404 for icell=1:numel(CellInfo) 407 405 VarIndex=CellInfo{icell}.VarIndex;% indices of the selected variables in the list data.ListVarName 408 406 coord_x_index=CellInfo{icell}.CoordIndex; 409 testplot=ones(size(data.ListVarName));%default test for plotted variables410 407 coord_x_name{icell}=data.ListVarName{coord_x_index}; 411 408 coord_x{icell}=data.(data.ListVarName{coord_x_index});%coordinate variable set as coord_x … … 573 570 end 574 571 572 %% give statistics for pdf 573 ind_var=find(testplot); 574 if numel(ind_var)==1 && isfield(data,'VarAttribute') && isfield(data.VarAttribute{ind_var},'Role') &&... 575 strcmp(data.VarAttribute{ind_var}.Role,'histo') 576 pdf_val=data.(data.ListVarName{ind_var}); 577 x=coord_x{1}; 578 TableData=cell(12,2); 579 TableData(:,1)={'SampleNbr';'Mean';'RMS';'Skewness';'Kurtosis';... 580 'Min';'FirstCentile';'FirstDecile';'Median';'LastDecile';'LastCentile';'Max'}; 581 Val=zeros(12,1); 582 Val(1)=sum(pdf_val);% total sample number 583 pdf_val=pdf_val/Val(1);% normalised pdf 584 Val(2)=sum(x.*pdf_val);%Mean 585 x=x-Val(2); %centered variable 586 Variance=sum(x.*x.*pdf_val); 587 Val(3)=sqrt(Variance); 588 Val(4)=(sum(x.*x.*x.*pdf_val))/(Variance*Val(3));%skewness 589 Val(5)=(sum(x.*x.*x.*x.*pdf_val))/(Variance*Variance);%kurtosis 590 Val(6)=min(x); 591 cumpdf=cumsum(pdf_val); 592 ind_centile=find(cumpdf>=0.01,1); 593 Val(7)=x(ind_centile); 594 ind_decile=find(cumpdf>=0.1,1); 595 Val(8)=x(ind_decile); 596 ind_median=find(cumpdf>= 0.5,1); 597 Val(9)=x(ind_median); 598 ind_decile=find(cumpdf>=0.9,1); 599 Val(10)=x(ind_decile); 600 ind_centile=find(cumpdf>=0.99,1); 601 Val(11)=x(ind_centile); 602 Val(12)=max(x); 603 TableData(:,2)=mat2cell(Val,ones(12,1),1) 604 TableData=[TableData(1:5,:);{' -- centered','stat: --'};TableData(6:12,:)]; 605 htable=findobj(hfig,'Tag','TableDisplay') 606 set(htable,'Data',TableData) 607 set(htable,'Visible','on') 608 drawnow 609 end 610 575 611 %------------------------------------------------------------------- 576 612 function [haxes,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellInfo,haxes,PlotParam)
Note: See TracChangeset
for help on using the changeset viewer.