Changeset 421 for trunk/src/plot_field.m


Ignore:
Timestamp:
May 14, 2012, 7:03:14 AM (9 years ago)
Author:
sommeria
Message:

bugs corrections and improvements following tutorial presentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r415 r421  
    5353%    .Scalar.CheckFixScal: =0 (default) lower and upper bounds of the scalar representation set to the min and max of the field
    5454%               =1 lower and upper bound imposed by .AMax and .MinA
    55 %    .Scalar.CheckBW= 1 black and white representation imposed, =0 by default.
     55%    .Scalar.CheckBW= 1: black and white representation imposed, =0 color imposed (color scale or rgb),
     56%                   =[]: automatic (B/W for integer positive scalars, color  else)
    5657%    .Scalar.CheckContours= 1: represent scalars by contour plots (Matlab function 'contour'); =0 by default
    5758%    .IncrA : contour interval
     
    214215    if isempty(index_2D)
    215216        plot_plane([],[],[],haxes);%removes images or vector plots if any
    216     else
     217    else  %plot 2D field
    217218        [tild,PlotParamOut,PlotType,errormsg]=plot_plane(Data,CellVarIndex(index_2D),VarType(index_2D),haxes,PlotParam,PosColorbar);
    218219        AxeData.NbDim=2;
     
    226227            plot_profile([],[],[],haxes);%
    227228        end
    228     else
     229    else %plot 1D field (usual graph y vs x)
    229230        Coordinates=plot_profile(Data,CellVarIndex(index_1D),VarType(index_1D),haxes,PlotParam.Coordinates);%
    230231        if testzoomaxes
     
    717718   
    718719    %set the color map
    719     if isfield(PlotParam.Scalar,'CheckBW')
    720         BW=PlotParam.Scalar.CheckBW; %test for BW gray scale images
    721     else
     720    if isfield(PlotParam.Scalar,'CheckBW') && ~isempty(PlotParam.Scalar.CheckBW)
     721        BW=PlotParam.Scalar.CheckBW; %BW=0 color imposed, else gray scale imposed.
     722    else % BW imposed automatically chosen
    722723        BW=(siz==2) && (isa(A,'uint8')|| isa(A,'uint16'));% non color images represented in gray scale by default
    723     end
    724    
     724        PlotParamOut.Scalar.CheckBW=BW;
     725    end
    725726    %case of grey level images or contour plot
    726727    if siz==2
     
    11451146    xN=NaN*ones(size(xc));
    11461147    matx=[xc(:)-uc(:)/2 xc(:)+uc(:)/2 xN(:)]';
    1147     %     matx=[xc(:) xc(:)+uc(:) xN(:)]';
    11481148    matx=reshape(matx,1,3*n(2));
    11491149    maty=[yc(:)-vc(:)/2 yc(:)+vc(:)/2 xN(:)]';
    1150     %     maty=[yc(:) yc(:)+vc(:) xN(:)]';
    11511150    maty=reshape(maty,1,3*n(2));
    11521151   
     
    11651164    matyar=reshape(matyar,1,4*n(2));
    11661165    %draw the line or modify the existing ones
    1167     tri=reshape(1:3*length(uc),3,[])';   
     1166%     tri=reshape(1:3*length(uc),3,[])';   
    11681167    isn=isnan(colorlist(icolor,:));%test if color NaN
    11691168    if 2*icolor > sizh(1) %if icolor exceeds the number of existing ones
Note: See TracChangeset for help on using the changeset viewer.