Ignore:
Timestamp:
May 21, 2018, 7:06:45 PM (6 years ago)
Author:
sommeria
Message:

find field cells improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r1031 r1045  
    115115%% check input structure
    116116% check the cells of fields :
    117 [CellInfo,NbDimArray,errormsg]=find_field_cells(Data);
    118 if ~isempty(errormsg)
    119     msgbox_uvmat('ERROR',['input of plot_field/find_field_cells: ' errormsg]);
    120     return
    121 end
    122 
    123 index_3D=find(NbDimArray>2,1);
    124 if ~isempty(index_3D)
    125     msgbox_uvmat('ERROR','volume plot not implemented yet');
    126     return
    127 end
    128 index_2D=find(NbDimArray==2);%find 2D fields
    129 index_1D=find(NbDimArray==1);
    130 index_0D=find(NbDimArray==0);
     117
     118% if ~isfield(PlotParam,'FieldName')
     119%     index_0D=[];
     120%     index_1D=1;
     121%     index_2D=[];%find 2D fields
     122%     index_3D=[];
     123% else
     124    [CellInfo,NbDimArray,errormsg]=find_field_cells(Data);
     125    if ~isempty(errormsg)
     126        msgbox_uvmat('ERROR',['input of plot_field/find_field_cells: ' errormsg]);
     127        return
     128    end
     129    index_0D=find(NbDimArray==0);
     130    index_1D=find(NbDimArray==1);
     131    index_2D=find(NbDimArray==2);%find 2D fields
     132    index_3D=find(NbDimArray>2,1);
     133    if ~isempty(index_3D)
     134        msgbox_uvmat('ERROR','volume plot not implemented yet');
     135        return
     136    end
     137% end
    131138
    132139%% test axes and figure
     
    228235    if ~isempty(htext)%&&~isempty(hchecktable)
    229236        if isempty(index_0D)
    230             %         set(htext,'Data',{})
    231             %         set(htext,'visible','off')
    232             %         set(hchecktable,'visible','off')
    233             %         set(hchecktable,'Value',0)
    234237        else
    235238            errormsg=plot_text(Data,CellInfo(index_0D),htext);
    236239            set(htext,'visible','on')
    237 %             set(hchecktable,'visible','on')
    238 %             set(hchecktable,'Value',1)
    239240        end
    240241        set(hfig,'Unit','pixels');
     
    409410%loop on input  fields
    410411for icell=1:numel(CellInfo)
    411     VarIndex=CellInfo{icell}.VarIndex;%  indices of the selected variables in the list data.ListVarName
    412     coord_x_index=CellInfo{icell}.CoordIndex;
     412    VarIndex=CellInfo{icell}.YIndex;%  indices of the selected variables in the list data.ListVarName
     413    coord_x_index=CellInfo{icell}.XIndex;
    413414    coord_x_name{icell}=data.ListVarName{coord_x_index};
    414415    coord_x{icell}=data.(data.ListVarName{coord_x_index});%coordinate variable set as coord_x
Note: See TracChangeset for help on using the changeset viewer.