Changeset 1094 for trunk/src/plot_field.m
- Timestamp:
- Mar 25, 2021, 9:37:04 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_field.m
r1093 r1094 768 768 test_interp_X=0; %default, regularly meshed X coordinate 769 769 test_interp_Y=0; %default, regularly meshed Y coordinate 770 if isfield(Data,'VarAttribute')771 if numel(Data.VarAttribute)>=CellInfo{icell}.CoordIndex(end) && isfield(Data.VarAttribute{CellInfo{icell}.CoordIndex(end)},'units')772 x_units=Data.VarAttribute{CellInfo{icell}.CoordIndex(end)}.units;773 end774 if numel(Data.VarAttribute)>=CellInfo{icell}.CoordIndex(end-1) && isfield(Data.VarAttribute{CellInfo{icell}.CoordIndex(end-1)},'units')775 y_units=Data.VarAttribute{CellInfo{icell}.CoordIndex(end-1)}.units;776 end777 end770 % if isfield(Data,'VarAttribute') 771 % if numel(Data.VarAttribute)>=CellInfo{icell}.CoordIndex(end) && isfield(Data.VarAttribute{CellInfo{icell}.CoordIndex(end)},'units') 772 % x_units=Data.VarAttribute{CellInfo{icell}.CoordIndex(end)}.units; 773 % end 774 % if numel(Data.VarAttribute)>=CellInfo{icell}.CoordIndex(end-1) && isfield(Data.VarAttribute{CellInfo{icell}.CoordIndex(end-1)},'units') 775 % y_units=Data.VarAttribute{CellInfo{icell}.CoordIndex(end-1)}.units; 776 % end 777 % end 778 778 if numel(Coord_y)>2 779 779 DCoord_y=diff(Coord_y); … … 790 790 DCoord_x_min=min(DCoord_x); 791 791 DCoord_x_max=max(DCoord_x); 792 if sign(DCoord_x_min)~=sign(DCoord_x_max) ;% =1 for increasing values, 0 otherwise792 if sign(DCoord_x_min)~=sign(DCoord_x_max)% =1 for increasing values, 0 otherwise 793 793 errormsg=['errror in plot_field.m: non monotonic dimension variable ' Data.ListVarName{VarRole.coord(2)} ]; 794 794 return … … 821 821 end 822 822 %define coordinates as CoordUnits, if not defined as attribute for each variable 823 % if isfield(Data,'VarAttribute')&& numel(Data.VarAttribute)>=1 && isfield(Data.VarAttribute{1},'unit') 824 % y_units=Data.VarAttribute{1}.unit; 825 % end 823 826 if isfield(Data,'CoordUnit') 824 827 if isempty(x_units) … … 827 830 if isempty(y_units) 828 831 y_units=Data.CoordUnit; 832 end 833 elseif isfield(Data,'VarAttribute') 834 if numel(Data.VarAttribute)>=CellInfo{icell}.CoordIndex(end) && isfield(Data.VarAttribute{CellInfo{icell}.CoordIndex(end)},'units') 835 x_units=Data.VarAttribute{CellInfo{icell}.CoordIndex(end)}.units; 836 end 837 if numel(Data.VarAttribute)>=CellInfo{icell}.CoordIndex(end-1) && isfield(Data.VarAttribute{CellInfo{icell}.CoordIndex(end-1)},'units') 838 y_units=Data.VarAttribute{CellInfo{icell}.CoordIndex(end-1)}.units; 829 839 end 830 840 end
Note: See TracChangeset
for help on using the changeset viewer.