Changeset 93 for trunk/src/plot_field.m


Ignore:
Timestamp:
May 27, 2010, 7:25:58 PM (14 years ago)
Author:
sommeria
Message:

FFT: improved to deal with NaN data
merge_proj: corrected to reproduce dt if unique
uvmat.fig: tooltip corrected
plot_field: bug for isocontour corrected,
im_filter: cleaning
phys_polar: spatial derivative included (still to check)
set_obeject.fig: minor correction
struct2nc: comments improved
uvmat: button NB implemented
read_civxdata: error message improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r92 r93  
    172172% check the cells of fields :
    173173% testnbdim=1;
    174 [CellVarIndex,NbDim,VarType,errormsg]=find_field_indices(Data);
     174[CellVarIndex,NbDim,VarType,errormsg]=find_field_indices(Data)
    175175
    176176if ~isempty(errormsg)
     
    324324coord_x_index=[];
    325325test_newplot=1;
    326 hh=findobj(haxes,'tag','plot_line');
     326% hh=findobj(haxes,'tag','plot_line');
    327327% num_curve=numel(hh);
    328 icurve=0;
     328% icurve=0;
    329329for icell=1:length(CellVarIndex)
    330330    testfalse=0;
     
    362362    end
    363363    eval(['coord_x{icell}=data.' data.ListVarName{coord_x_index} ';']);%coordinate variable set as coord_x
    364     testcoordvar=1;
     364%     testcoordvar=1;
    365365    testplot(coord_x_index)=0;
    366366    if ~isempty(VarType{icell}.ancillary')
     
    425425                eval(['varmean=mean(double(data.' VarName '));']);%mean value
    426426                textmean=[textmean; {[VarName 'mean= ' num2str(varmean,4)]}];
    427                 if nbcomponent1==1| nbcomponent2==1
     427                if nbcomponent1==1|| nbcomponent2==1
    428428                    legend_str=[legend_str {VarName}]; %variable with one component
    429429                else  %variable with severals  components
     
    553553        VarType.coord=VarType.coord(ind_coord);
    554554    end
    555     idim_Y=[]; 
     555%     idim_Y=[]; 
    556556    test_grid=0;
    557557    if ~isempty(ivar_U) && ~isempty(ivar_V)% vector components detected
     
    563563            eval(['vec_U=Data.' Data.ListVarName{ivar_U} ';'])
    564564            eval(['vec_V=Data.' Data.ListVarName{ivar_V} ';'])
    565             'TESTplot'
    566             VarType.coord
    567565            if ~isempty(ivar_X) && ~isempty(ivar_Y)% 2D field (with unstructured coordinates or structured ones (then ivar_X and ivar_Y empty)     
    568566                eval(['vec_X=Data.' Data.ListVarName{ivar_X} ';'])
     
    748746            end
    749747            if ~isfield(PlotParam.Scalar,'IncrA')
    750                 PlotParam.Scalar.IncrA=[];
    751             end
    752             if isempty(PlotParam.Scalar.IncrA)% | PlotParam.Scalar.AutoScal==0
     748                PlotParam.Scalar.IncrA=NaN;
     749            end
     750            if isnan(PlotParam.Scalar.IncrA)% | PlotParam.Scalar.AutoScal==0
    753751                cont=colbartick(MinA,MaxA);
    754752                intercont=cont(2)-cont(1);%default
     
    767765            sizpx=(AX(end)-AX(1))/(np(2)-1);
    768766            sizpy=(AY(1)-AY(end))/(np(1)-1);
    769             x_cont=[AX(1):sizpx:AX(end)]; % pixel x coordinates for image display
     767            x_cont=AX(1):sizpx:AX(end); % pixel x coordinates for image display
    770768            y_cont=AY(1):-sizpy:AY(end); % pixel x coordinates for image display
    771769            txt=ver;%version of Matlab
     
    857855    %display the colorbar code for B/W images if Poscolorbar not empty
    858856    if siz==2 && exist('PosColorbar','var')&& ~isempty(PosColorbar)
    859         if isempty(hcol)|~ishandle(hcol)
     857        if isempty(hcol)||~ishandle(hcol)
    860858             hcol=colorbar;%create new colorbar
    861859        end
     
    981979        end
    982980        nb_sel=length(ind_sel);
    983         ind_sel=ind_sel([1:2:nb_sel]);% take half the points on a line
     981        ind_sel=ind_sel(1:2:nb_sel);% take half the points on a line
    984982        vec_X=vec_X(ind_sel);
    985983        vec_Y=vec_Y(ind_sel);
Note: See TracChangeset for help on using the changeset viewer.