Changeset 128 for trunk/src/plot_field.m


Ignore:
Timestamp:
Nov 21, 2010, 10:06:11 PM (13 years ago)
Author:
sommeria
Message:

series: give writting access to the group for all subdirectories produced
uvmat.fig: change of vect and scalar frames (to be consistent with view_field)
uvmat: various cleaning
plot_field: various cleaning to improve axes definition and avoid blinking
geometry_calib: improved dispay of point coordiantes, improved link with dataview for REPLICATE.
struct2nc: repair bug , file was not closed.
cell2tab: cleaning
dataview: improve the browser
civ: solve pb of image naming

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r109 r128  
    105105% use htext: handles of the text edit box (uicontrol)
    106106% introduce PlotParam.Hold: 'on' or 'off' (for curves)
    107  
     107
    108108%default output
    109109if ~exist('PlotParam','var'),PlotParam=[];end;
     
    127127    if ishandle(haxes)
    128128        if isequal(get(haxes,'Type'),'axes')
    129             axes(haxes)
     129%             axes(haxes)
    130130            testnewfig=0;
    131131            AxeData=get(haxes,'UserData');
     
    139139    end
    140140end
     141
    141142if testnewfig% create a new figure and axes if the plotting axes does not exist
    142143    hfig=figure;
     
    157158    haxes=axes;
    158159    set(haxes,'position',[0.13,0.2,0.775,0.73])
    159 else
    160     hstack=findobj(allchild(0),'Type','figure');%current stack order of figures in matlab
    161160end
    162161if isfield(PlotParam,'text_display_1') && ishandle(PlotParam.text_display_1)
     
    182181    [Data.NbDim]=max(NbDim);
    183182end
     183errormsg=[];
    184184if isequal(Data.NbDim,0)
    185185        AxeData=plot_text(Data,htext);
    186186        PlotType='text';
     187        errormsg=[];
    187188elseif isequal(Data.NbDim,1)
    188     [AxeData,haxes]=plot_profile(Data,CellVarIndex,VarType,haxes,PlotParam);%
     189    [AxeData]=plot_profile(Data,CellVarIndex,VarType,haxes,PlotParam);%
    189190    if testzoomaxes
    190191        [AxeData,zoomaxes,PlotParamOut]=plot_profile(Data,CellVarIndex,VarType,zoomaxes,PlotParam);
     
    192193    end
    193194    PlotType='line';
     195    errormsg=[];
    194196elseif isequal(Data.NbDim,2)
    195197    ind_select=find(NbDim>=2);
    196198    if numel(ind_select)>2
    197         msgbox_uvmat('ERROR','more than two fields to map')
    198         display('more than two fields to map')
    199         return
    200     end
    201     [AxeData,haxes,PlotParamOut,PlotType]=plot_plane(Data,CellVarIndex(ind_select),VarType(ind_select),haxes,PlotParam,htext,PosColorbar);
    202     if testzoomaxes
    203         [AxeData,zoomaxes,PlotParamOut]=plot_plane(Data,CellVarIndex(ind_select),VarType(ind_select),zoomaxes,PlotParam,1,PosColorbar);
    204         %AxeData.ZoomAxes=zoomaxes;
    205         Data.ZoomAxes=zoomaxes;
     199        errormsg='more than two fields to map';
     200    else
     201        [AxeData,xx,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellVarIndex(ind_select),VarType(ind_select),haxes,PlotParam,htext,PosColorbar);
     202        if testzoomaxes && isempty(errormsg)
     203            [AxeData,zoomaxes,PlotParamOut,xx,errormsg]=plot_plane(Data,CellVarIndex(ind_select),VarType(ind_select),zoomaxes,PlotParam,1,PosColorbar);
     204            %AxeData.ZoomAxes=zoomaxes;
     205            Data.ZoomAxes=zoomaxes;
     206        end
    206207    end
    207208elseif isequal(Data.NbDim,3)
     209    errormsg='volume plot not implemented yet';
     210end
     211if ~isempty(errormsg)
    208212    msgbox_uvmat('ERROR','volume plot not implemented yet')
    209213    return
    210 % else
    211 %     testnbdim=0;
    212214end
    213215
     
    234236%set(haxes,'UserData',AxeData)
    235237set(haxes,'UserData',Data)
    236 if ~testnewfig
    237 set(0,'Children',hstack);%put back the initial figure stack after plot creation
    238 %set(haxes,'Tag','uvmat');
    239 end
     238% if ~testnewfig
     239% %set(0,'Children',hstack);%put back the initial figure stack after plot creation
     240%
     241% end
    240242
    241243
     
    303305function [AxeData,haxes]=plot_profile(data,CellVarIndex,VarType,haxes,PlotParam)
    304306%-------------------------------------------------------------------
    305 %axes(haxes)
     307%TODO: modify existing plot if it exists
     308
    306309hfig=get(haxes,'parent');
    307310AxeData=data;
     
    322325legend_str={};
    323326
    324 %initiates string of the plot command
     327%% prepare the string for plot command
     328%initiate  the plot command
    325329plotstr='hhh=plot(';
    326330textmean={};
    327 % abscissa_name='';
    328331coord_x_index=[];
    329332test_newplot=1;
     
    331334% num_curve=numel(hh);
    332335% icurve=0;
     336
     337%loop on input  fields
    333338for icell=1:length(CellVarIndex)
    334     testfalse=0;
    335339    VarIndex=CellVarIndex{icell};%  indices of the selected variables in the list data.ListVarName
    336     DimCell=data.VarDimName{VarIndex(1)};
    337     if ischar(DimCell)
    338         DimCell={DimCell};
    339     end
    340     XName=DimCell{1}; %first dimension considered as abscissa
    341340    if ~isempty(VarType{icell}.coord_x)
    342341        coord_x_index=VarType{icell}.coord_x;
     
    353352    end
    354353    testplot=ones(size(data.ListVarName));%default test for plotted variables
    355     testcoordvar=0;
    356     charplot_0='''-''';%default
    357     if isfield(data,'ObjectProjMode')&& isequal(data.ObjectProjMode,'projection')
    358         charplot_0='+';
    359     end
    360     xtitle=''; 
    361    
    362354    xtitle=data.ListVarName{coord_x_index};
    363355    eval(['coord_x{icell}=data.' data.ListVarName{coord_x_index} ';']);%coordinate variable set as coord_x
    364356    if isfield(data,'VarAttribute')&& numel(data.VarAttribute)>=coord_x_index && isfield(data.VarAttribute{coord_x_index},'units')
    365          xtitle=[xtitle '(' data.VarAttribute{coord_x_index}.units ')'];
     357        xtitle=[xtitle '(' data.VarAttribute{coord_x_index}.units ')'];
    366358    end
    367359    eval(['coord_x{icell}=data.' data.ListVarName{coord_x_index} ';']);%coordinate variable set as coord_x
    368 %     testcoordvar=1;
    369360    testplot(coord_x_index)=0;
    370361    if ~isempty(VarType{icell}.ancillary')
    371             testplot(VarType{icell}.ancillary)=0;
     362        testplot(VarType{icell}.ancillary)=0;
    372363    end
    373364    if ~isempty(VarType{icell}.warnflag')
    374             testplot(VarType{icell}.warnflag)=0;
    375     end
    376  
     365        testplot(VarType{icell}.warnflag)=0;
     366    end
    377367    if isfield(data,'VarAttribute')
    378368        VarAttribute=data.VarAttribute;
    379         for ivar=1:length(VarIndex)
    380              if length(VarAttribute)>=VarIndex(ivar) && isfield(VarAttribute{VarIndex(ivar)},'long_name')
    381                  plotname{VarIndex(ivar)}=VarAttribute{VarIndex(ivar)}.long_name;
    382              else
    383                  plotname{VarIndex(ivar)}=data.ListVarName{VarIndex(ivar)};%name for display in plot A METTRE
    384              end
    385         end
    386     end 
    387 %     test_newplot=0;%default
    388 %     if num_curve>=icurve+numel(find(testplot(VarIndex)))%update existing curves
    389 %         if ~isempty(VarType{icell}.discrete')
    390 %             charplot_0='+';
    391 %             LineStyle='none';
    392 %         else
    393 %             charplot_0='none';
    394 %             LineStyle='-';
    395 %         end
    396 %         for ivar=1:length(VarIndex)
    397 %             if testplot(VarIndex(ivar))
    398 %                 icurve=icurve+1;
    399 %                 VarName=data.ListVarName{VarIndex(ivar)};
    400 %                 eval(['data.' VarName '=squeeze(data.' VarName ');'])
    401 %                 set(hh(icurve),'LineStyle',LineStyle)
    402 %                 set(hh(icurve),'Marker',charplot_0)
    403 %                 set(hh(icurve),'XData',coord_x{icell})
    404 %                 eval(['yy=data.' VarName ';'])
    405 %                 set(hh(icurve),'YData',yy);
    406 %             end
    407 %         end
    408 %     else% new plot
    409         if ~isempty(VarType{icell}.discrete')
    410             charplot_0='''+''';
    411         else
    412             charplot_0='''-''';
    413         end
    414369        for ivar=1:length(VarIndex)
    415             if testplot(VarIndex(ivar))
    416                 VarName=data.ListVarName{VarIndex(ivar)};
    417                 eval(['data.' VarName '=squeeze(data.' VarName ');'])
    418 %                 if isequal(VarName,'A')
    419 %                     charplot='''-''';
    420 %                 else
    421 %                     charplot=charplot_0;
    422 %                 end
    423                 plotstr=[plotstr 'coord_x{' num2str(icell) '},data.' VarName ',' charplot_0 ','];
    424                 eval(['nbcomponent2=size(data.' VarName ',2);']);
    425                 eval(['nbcomponent1=size(data.' VarName ',1);']);
    426                 if numel(coord_x{icell})==2
    427                     coord_x{icell}=linspace(coord_x{icell}(1),coord_x{icell}(2),nbcomponent1);
    428                 end
    429                 eval(['varmean=mean(double(data.' VarName '));']);%mean value
    430                 textmean=[textmean; {[VarName 'mean= ' num2str(varmean,4)]}];
    431                 if nbcomponent1==1|| nbcomponent2==1
    432                     legend_str=[legend_str {VarName}]; %variable with one component
    433                 else  %variable with severals  components
    434                     for ic=1:min(nbcomponent1,nbcomponent2)
    435                         legend_str=[legend_str [VarName '_' num2str(ic)]]; %variable with severals  components
    436                     end                                                   % labeled by their index (e.g. color component)
    437                 end
    438             end
    439         end
    440 %     end
    441 end
     370            if length(VarAttribute)>=VarIndex(ivar) && isfield(VarAttribute{VarIndex(ivar)},'long_name')
     371                plotname{VarIndex(ivar)}=VarAttribute{VarIndex(ivar)}.long_name;
     372            else
     373                plotname{VarIndex(ivar)}=data.ListVarName{VarIndex(ivar)};%name for display in plot A METTRE
     374            end
     375        end
     376    end
     377    %     test_newplot=0;%default
     378    %     if num_curve>=icurve+numel(find(testplot(VarIndex)))%update existing curves
     379    %         if ~isempty(VarType{icell}.discrete')
     380    %             charplot_0='+';
     381    %             LineStyle='none';
     382    %         else
     383    %             charplot_0='none';
     384    %             LineStyle='-';
     385    %         end
     386    %         for ivar=1:length(VarIndex)
     387    %             if testplot(VarIndex(ivar))
     388    %                 icurve=icurve+1;
     389    %                 VarName=data.ListVarName{VarIndex(ivar)};
     390    %                 eval(['data.' VarName '=squeeze(data.' VarName ');'])
     391    %                 set(hh(icurve),'LineStyle',LineStyle)
     392    %                 set(hh(icurve),'Marker',charplot_0)
     393    %                 set(hh(icurve),'XData',coord_x{icell})
     394    %                 eval(['yy=data.' VarName ';'])
     395    %                 set(hh(icurve),'YData',yy);
     396    %             end
     397    %         end
     398    %     else% new plot
     399    if ~isempty(VarType{icell}.discrete')
     400        charplot_0='''+''';
     401    else
     402        charplot_0='''-''';
     403    end
     404    for ivar=1:length(VarIndex)
     405        if testplot(VarIndex(ivar))
     406            VarName=data.ListVarName{VarIndex(ivar)};
     407            eval(['data.' VarName '=squeeze(data.' VarName ');'])
     408            plotstr=[plotstr 'coord_x{' num2str(icell) '},data.' VarName ',' charplot_0 ','];
     409            eval(['nbcomponent2=size(data.' VarName ',2);']);
     410            eval(['nbcomponent1=size(data.' VarName ',1);']);
     411            if numel(coord_x{icell})==2
     412                coord_x{icell}=linspace(coord_x{icell}(1),coord_x{icell}(2),nbcomponent1);
     413            end
     414            eval(['varmean=mean(double(data.' VarName '));']);%mean value
     415            textmean=[textmean; {[VarName 'mean= ' num2str(varmean,4)]}];
     416            if nbcomponent1==1|| nbcomponent2==1
     417                legend_str=[legend_str {VarName}]; %variable with one component
     418            else  %variable with severals  components
     419                for ic=1:min(nbcomponent1,nbcomponent2)
     420                    legend_str=[legend_str [VarName '_' num2str(ic)]]; %variable with severals  components
     421                end                                                   % labeled by their index (e.g. color component)
     422            end
     423        end
     424    end
     425end
     426
     427%% activate the plot
    442428if test_newplot && ~isequal(plotstr,'hhh=plot(')
    443429    plotstr=[plotstr '''tag'',''plot_line'');'];
    444430                %execute plot (instruction  plotstr) 
     431    axes(haxes)% select the plotting axes for plot operation
    445432    eval(plotstr)
    446433   
     
    502489
    503490%-------------------------------------------------------------------
    504 function [AxeData,haxes,PlotParamOut,PlotType]=plot_plane(Data,CellVarIndex,VarTypeCell,haxes,PlotParam,htext,PosColorbar)
     491function [AxeData,haxes,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellVarIndex,VarTypeCell,haxes,PlotParam,htext,PosColorbar)
    505492%-------------------------------------------------------------------
     493
    506494grid(haxes, 'off')
    507495%default plotting parameters
     
    517505end
    518506PlotParamOut=PlotParam;%default
    519 
    520 %plotting axes
    521507hfig=get(haxes,'parent');
    522508hcol=findobj(hfig,'Tag','Colorbar'); %look for colorbar axes
     
    530516    AxeData.ObjectCoord=Data.ObjectCoord;
    531517end
    532 
     518errormsg=[];%default
    533519test_ima=0; %default: test for image or map plot
    534520test_vec=0; %default: test for vector plots
     
    548534    ivar_C=[VarType.scalar VarType.image VarType.color VarType.ancillary]; %defines index (indices) for the scalar or ancillary fields
    549535    if numel(ivar_C)>1
    550         msgbox_uvmat('ERROR','error in plot_field: too many scalar inputs')
     536        errormsg= 'error in plot_field: too many scalar inputs';
    551537        return
    552538    end
     
    558544    end
    559545%     idim_Y=[]; 
    560     test_grid=0;
     546%     test_grid=0;
    561547    if ~isempty(ivar_U) && ~isempty(ivar_V)% vector components detected
    562548        if test_vec
    563             msgbox_uvmat('ERROR','error in plot_field: attempt to plot two vector fields')
     549            errormsg='error in plot_field: attempt to plot two vector fields';
    564550            return
    565551        else
     
    570556                eval(['vec_X=Data.' Data.ListVarName{ivar_X} ';'])
    571557                eval(['vec_Y=Data.' Data.ListVarName{ivar_Y} ';'])
    572             elseif numel(VarType.coord)==2 & VarType.coord~=[0 0];%coordinates defines by dimension variables
     558            elseif numel(VarType.coord)==2 && ~isequal(VarType.coord,[0 0]);%coordinates defines by dimension variables
    573559                eval(['y=Data.' Data.ListVarName{VarType.coord(1)} ';'])
    574560                eval(['x=Data.' Data.ListVarName{VarType.coord(2)} ';'])
     
    581567                [vec_X,vec_Y]=meshgrid(x,y); 
    582568            else
    583                 msgbox_uvmat('ERROR','error in plot_field: invalid coordinate definition for vector field')
     569                errormsg='error in plot_field: invalid coordinate definition for vector field';
    584570                return
    585571            end
     
    605591    elseif ~isempty(ivar_C) %scalar or image
    606592        if test_ima
    607              msgbox_uvmat('ERROR','attempt to plot two scalar fields or images')
     593             errormsg='attempt to plot two scalar fields or images';
    608594            return
    609595        end
     
    635621                    x_units=['(' Data.VarAttribute{VarType.coord(2)}.units ')'];
    636622                end
    637                 if numel(Data.VarAttribute)>=VarType.coord(1) & isfield(Data.VarAttribute{VarType.coord(1)},'units')
     623                if numel(Data.VarAttribute)>=VarType.coord(1) && isfield(Data.VarAttribute{VarType.coord(1)},'units')
    638624                    y_units=['(' Data.VarAttribute{VarType.coord(1)}.units ')'];
    639625                end
     
    644630                DAY_max=max(DAY);
    645631                if sign(DAY_min)~=sign(DAY_max);% =1 for increasing values, 0 otherwise
    646                      errormsg=['errror in plot_field.m: non monotonic dimension variable # ' ListVarName{VarType.coord(1)} ];
     632                     errormsg=['errror in plot_field.m: non monotonic dimension variable ' Data.ListVarName{VarType.coord(1)} ];
    647633                      return
    648634                end
     
    654640                DAX_max=max(DAX);
    655641                if sign(DAX_min)~=sign(DAX_max);% =1 for increasing values, 0 otherwise
    656                      errormsg=['errror in plot_field.m: non monotonic dimension variable # ' ListVarName{VarType.coord(2)} ];
     642                     errormsg=['errror in plot_field.m: non monotonic dimension variable ' Data.ListVarName{VarType.coord(2)} ];
    657643                      return
    658644                end
     
    682668            AY=[AY(1) AY(end)];
    683669        else
    684             msgbox_uvmat('ERROR','error in plot_field: invalid coordinate definition ')
     670            errormsg='error in plot_field: invalid coordinate definition ';
    685671            return
    686672        end
    687           x_label=[Data.ListVarName{ivar_X} '(' x_units ')'];
     673          %x_label=[Data.ListVarName{ivar_X} '(' x_units ')'];
    688674    end         
    689675end
    690676
    691 %%%%%%%%%%%%%%%%%%%%%   image or scalar plot %%%%%%%%%%%%%%%%%%%%%%%%%%
     677%%   image or scalar plot %%%%%%%%%%%%%%%%%%%%%%%%%%
    692678
    693679if ~isfield(PlotParam.Scalar,'Contours')
     
    700686    siz=numel(np);
    701687    if siz>3
    702         msgbox_uvmat('ERROR',['unrecognized scalar type: ' num2str(siz) ' dimensions'])
     688       errormsg=['unrecognized scalar type: ' num2str(siz) ' dimensions'];
    703689            return
    704690    end
     
    709695            siz=3;%color image
    710696        else
    711              msgbox_uvmat('ERROR',['unrecognized scalar type: ' num2str(np(3)) ' color components'])
     697            errormsg=['unrecognized scalar type: ' num2str(np(3)) ' color components'];
    712698            return
    713699        end
    714700    end
     701   
    715702    %set the color map
    716703    if isfield(PlotParam.Scalar,'BW')
     
    719706        BW=(siz==2) && (isa(A,'uint8')|| isa(A,'uint16'));% non color images represented in gray scale by default
    720707    end
    721     if siz==2 %for black and white images
     708   
     709    %case of grey level images or contour plot
     710    if siz==2
    722711        if ~isfield(PlotParam.Scalar,'AutoScal')
    723712            PlotParam.Scalar.AutoScal=0;%default
     
    729718            PlotParam.Scalar.MaxA=[];%default
    730719        end
    731         if isequal(PlotParam.Scalar.AutoScal,0)|isempty(PlotParam.Scalar.MinA)|~isa(PlotParam.Scalar.MinA,'double')  %correct if there is no numerical data in edit box
     720        if isequal(PlotParam.Scalar.AutoScal,0)||isempty(PlotParam.Scalar.MinA)||~isa(PlotParam.Scalar.MinA,'double')  %correct if there is no numerical data in edit box
    732721            MinA=double(min(min(A)));
    733722        else
     
    741730        PlotParamOut.Scalar.MinA=MinA;
    742731        PlotParamOut.Scalar.MaxA=MaxA;
    743         axes(haxes)
     732       
     733        % case of contour plot
    744734        if isequal(PlotParam.Scalar.Contours,1)
    745             if ~isempty(hima) & ishandle(hima)
     735            if ~isempty(hima) && ishandle(hima)
    746736                delete(hima)
    747737            end
     
    770760            txt=ver;%version of Matlab
    771761            Release=txt(1).Release;
    772             relnumb=str2num(Release(3:4));
     762            relnumb=str2double(Release(3:4));
    773763            if relnumb >= 14
    774764                    vec=linspace(0,1,(abscontmax-abscontmin)/intercont);%define a greyscale colormap with steps intercont
     
    788778            colormap(map);
    789779        end
     780       
     781        % set  colormap for  image display
    790782        if ~isequal(PlotParam.Scalar.Contours,1) 
    791783            % rescale the grey levels with min and max, put a grey scale colorbar
     
    799791            end
    800792        end
    801     else %color images
    802         axes(haxes)
     793       
     794    % case of color images
     795    else
    803796        if BW
    804797            B=uint16(sum(A,3));
     
    809802        MaxA=255;
    810803    end
    811     if ~isequal(PlotParam.Scalar.Contours,1)
    812         %interpolate to increase resolution
     804   
     805    % display usual image
     806    if ~isequal(PlotParam.Scalar.Contours,1)     
     807        % interpolate field to increase resolution of image display
    813808        test_interp=1;
    814809        if max(np) <= 64
     
    829824            yi=linspace(AY(1),AY(2),npxy(1));
    830825            B = interp2(X,Y,double(B),xi,yi');
    831         end       
     826        end           
     827        % create new image if there  no image handle is found
    832828        if isempty(hima)
     829           % axes(haxes)% set haxes the current axes for image creation
     830            set(hfig,'CurrentAxes',haxes) % set haxes the current axes for image creation
    833831            tag=get(haxes,'Tag');
    834832            if MinA<MaxA
    835833                hima=imagesc(AX,AY,B,[MinA MaxA]);
    836             else
     834            else % to deal with uniform field
    837835                hima=imagesc(AX,AY,B,[MaxA-1 MaxA]);
    838836            end
    839837            set(hima,'Tag','ima','HitTest','off')
    840             set(haxes,'Tag',tag);%preserve the axes tag (removed by image fct !!!)       
     838            set(haxes,'Tag',tag);%preserve the axes tag (removed by image fct !!!)           
     839        % update an existing image
    841840        else
    842841            set(hima,'CData',B);
     
    857856    AxeData.AY=[AY(1) AY(end)];
    858857    test_ima=1;
     858   
    859859    %display the colorbar code for B/W images if Poscolorbar not empty
    860860    if siz==2 && exist('PosColorbar','var')&& ~isempty(PosColorbar)
     
    865865                 set(hcol,'Position',PosColorbar)           
    866866        end
    867         YTick=0;%default
     867        %YTick=0;%default
    868868        if MaxA>MinA
    869869            if isequal(PlotParam.Scalar.Contours,1)
     
    873873                YTick_scaled=colbarlim(1)+scale_bar*(YTick-abscontmin);
    874874                set(hcol,'YTick',YTick_scaled);
    875             elseif (isfield(PlotParam.Scalar,'BW') & isequal(PlotParam.Scalar.BW,1))|isa(A,'uint8')| isa(A,'uint16')%images
     875            elseif (isfield(PlotParam.Scalar,'BW') && isequal(PlotParam.Scalar.BW,1))||isa(A,'uint8')|| isa(A,'uint16')%images
    876876                hi=get(hcol,'children');
    877877                if iscell(hi)%multiple images in colorbar
     
    879879                end
    880880                set(hi,'YData',[MinA MaxA])
    881                 set(hi,'CData',[1:256]')
     881                set(hi,'CData',(1:256)')
    882882                set(hcol,'YLim',[MinA MaxA])
    883883                YTick=colbartick(MinA,MaxA);
     
    889889                end
    890890                set(hi,'YData',[MinA MaxA])
    891                 set(hi,'CData',[1:64]')
     891                set(hi,'CData',(1:64)')
    892892                YTick=colbartick(MinA,MaxA);
    893893                set(hcol,'YLim',[MinA MaxA])
     
    912912end
    913913
    914 %%%%%%%%%%%%%%%%%%%%%   vector plot %%%%%%%%%%%%%%%%%%%%%%%%%%
     914%%   vector plot %%%%%%%%%%%%%%%%%%%%%%%%%%
    915915if test_vec
    916916   %vector scale representation
     
    927927    if  ~isfield(PlotParam.Vectors,'AutoVec') || isequal(PlotParam.Vectors.AutoVec,0)|| ~isfield(PlotParam.Vectors,'VecScale')...
    928928               ||isempty(PlotParam.Vectors.VecScale)||~isa(PlotParam.Vectors.VecScale,'double') %automatic vector scale
    929         scale=[];
     929%         scale=[];
    930930        if test_false %remove false vectors
    931931            indsel=find(AxeData.FF==0);%indsel =indices of good vectors
     
    10451045listdim={'AY','AX',{'AY','AX'},'nb_vectors','nb_vectors','nb_vectors','nb_vectors','nb_vectors','nb_vectors','nb_vectors','nb_vectors'};
    10461046Role={'coord_y','coord_x','scalar','coord_x','coord_y','vector_x','vector_y','scalar','vector_z','warnflag','errorflag'};
    1047 ind_select=[];
     1047%ind_select=[];
    10481048nbvar=0;
    10491049AxeData.ListVarName={};
     
    11681168    isn=isnan(colorlist(icolor,:));%test if color NaN
    11691169    if 2*icolor > sizh(1) %if icolor exceeds the number of existing ones
    1170         axes(haxes)
     1170        %axes(haxes)
     1171        hfig=get(haxes,'parent');
     1172%         axes(haxes)
     1173        set(0,'CurrentFigure',hfig)
     1174        set(hfig,'CurrentAxes',haxes)
    11711175        if ~isn(1) %if the vectors are visible color not nan
    11721176            if n(2)>0
Note: See TracChangeset for help on using the changeset viewer.