Changeset 517 for trunk/src/plot_field.m
- Timestamp:
- Aug 17, 2012, 11:47:16 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_field.m
r515 r517 540 540 for icell=1:length(CellVarIndex) % length(CellVarIndex) =1 or 2 (from the calling function) 541 541 VarType=VarTypeCell{icell}; 542 if ~isempty(VarType.coord_tps) 542 if ~isempty(VarType.coord_tps) %do not plot directly tps data (used for projection only) 543 543 continue 544 544 end … … 566 566 vec_U=Data.(Data.ListVarName{ivar_U}); 567 567 vec_V=Data.(Data.ListVarName{ivar_V}); 568 if ~isempty(ivar_X) && ~isempty(ivar_Y)% 2D field (with unstructured coordinates or structured ones (then ivar_X and ivar_Y empty)568 if ~isempty(ivar_X) && ~isempty(ivar_Y)% 2D field with unstructured coordinates 569 569 XName=Data.ListVarName{ivar_X}; 570 570 YName=Data.ListVarName{ivar_Y}; 571 eval(['vec_X=reshape(Data.' XName ',[],1);'])572 eval(['vec_Y=reshape(Data.' YName ',[],1);'])571 vec_X=reshape(Data.(XName),[],1); %transform vectors in column matlab vectors 572 vec_Y=reshape(Data.(YName),[],1); 573 573 elseif numel(VarType.coord)==2 && ~isequal(VarType.coord,[0 0]);%coordinates defines by dimension variables 574 eval(['y=Data.' Data.ListVarName{VarType.coord(1)} ';'])575 eval(['x=Data.' Data.ListVarName{VarType.coord(2)} ';'])574 y=Data.(Data.ListVarName{VarType.coord(1)}); 575 x=Data.(Data.ListVarName{VarType.coord(2)}); 576 576 if numel(y)==2 % y defined by first and last values on aregular mesh 577 577 y=linspace(y(1),y(2),size(vec_U,1)); … … 585 585 return 586 586 end 587 if ~isempty(ivar_C) 588 eval(['vec_C=Data.' Data.ListVarName{ivar_C} ';']) ; 589 vec_C=reshape(vec_C,1,numel(vec_C)); 587 if isfield(PlotParam.Vectors,'ColorScalar') && ~isempty(PlotParam.Vectors.ColorScalar) 588 [VarVal,ListVarName,VarAttribute,errormsg]=calc_field_interp([],Data,PlotParam.Vectors.ColorScalar); 589 % if ~isempty(ivar_C) 590 %vec_C=Data.(Data.ListVarName{ivar_C}); 591 if ~isempty(VarVal) 592 vec_C=reshape(VarVal{1},1,numel(VarVal{1})); 590 593 test_C=1; 594 end 591 595 end 592 596 if ~isempty(ivar_F)%~(isfield(PlotParam.Vectors,'HideWarning')&& isequal(PlotParam.Vectors.HideWarning,1))
Note: See TracChangeset
for help on using the changeset viewer.