Changeset 644 for trunk/src/plot_field.m


Ignore:
Timestamp:
May 28, 2013, 11:30:01 PM (10 years ago)
Author:
sommeria
Message:

various improvements: resize GUI uvmat, projection on lines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r625 r644  
    197197    end
    198198else %plot 1D field (usual graph y vs x)
    199     PlotParamOut.Coordinates=plot_profile(Data,CellInfo(index_1D),haxes,PlotParamOut.Coordinates);%
     199    CheckHold=0;
     200    if isfield(PlotParam,'CheckHold')
     201        CheckHold= PlotParam.CheckHold;
     202    end       
     203    PlotParamOut.Coordinates=plot_profile(Data,CellInfo(index_1D),haxes,PlotParamOut.Coordinates,CheckHold);%
    200204    if testzoomaxes
    201         [zoomaxes,PlotParamOut.Coordinates]=plot_profile(Data,CellInfo(index_1D),zoomaxes,PlotParamOut.Coordinates);
     205        [zoomaxes,PlotParamOut.Coordinates]=plot_profile(Data,CellInfo(index_1D),zoomaxes,PlotParamOut.Coordinates,CheckHold);
    202206        AxeData.ZoomAxes=zoomaxes;
    203207    end
    204 %     if ~isempty(Coordinates)
    205 %         PlotParamOut.Coordinates=Coordinates;
    206 %     end
    207208    PlotType='line';
    208209end
     
    327328
    328329%-------------------------------------------------------------------
    329 function CoordinatesOut=plot_profile(data,CellInfo,haxes,Coordinates)
     330function CoordinatesOut=plot_profile(data,CellInfo,haxes,Coordinates,CheckHold)
    330331%-------------------------------------------------------------------
    331332
     333%% initialization
    332334if ~exist('Coordinates','var')
    333335    Coordinates=[];
     
    335337CoordinatesOut=Coordinates; %default
    336338hfig=get(haxes,'parent');
    337 %suppress existing plot isf empty data
     339legend_str={};
     340
     341%% suppress existing plot if empty data
    338342if isempty(data)
    339343    hplot=findobj(haxes,'tag','plot_line');
     
    348352end
    349353
     354%% set the colors of the successive plots (designed to produce rgb for the three components of color images)
    350355ColorOrder=[1 0 0;0 0.5 0;0 0 1;0 0.75 0.75;0.75 0 0.75;0.75 0.75 0;0.25 0.25 0.25];
    351356set(haxes,'ColorOrder',ColorOrder)
    352 if isfield(Coordinates,'NextPlot')
    353     set(haxes,'NextPlot',Coordinates.NextPlot)
    354 end
    355 % adjust the size of the plot to include the whole field,
    356 
    357 legend_str={};
     357% if isfield(Coordinates,'NextPlot')
     358%     set(haxes,'NextPlot',Coordinates.NextPlot)
     359% end
     360if CheckHold
     361     set(haxes,'NextPlot','add')
     362else
     363    set(haxes,'NextPlot','replace')
     364end
    358365
    359366%% prepare the string for plot command
    360367plotstr='hhh=plot(';
    361 coord_x_index=[];
     368% coord_x_index=[];
    362369xtitle='';
    363370ytitle='';
    364 test_newplot=1;
     371test_newplot=~CheckHold;
    365372MinX=[];
    366373MaxX=[];
     
    421428            end
    422429            eval(['data.' VarName '=squeeze(data.' VarName ');'])
    423             %eval(['min(data.' VarName ')'])
    424430            MinY(ivar)=min(min(data.(VarName)));
    425431            MaxY(ivar)=max(max(data.(VarName)));
     
    446452
    447453%% activate the plot
    448 if test_newplot && ~isequal(plotstr,'hhh=plot(') 
     454if ~isequal(plotstr,'hhh=plot(') 
    449455    set(hfig,'CurrentAxes',haxes)
    450456    tag=get(haxes,'tag');   
Note: See TracChangeset for help on using the changeset viewer.