Changeset 644 for trunk/src/plot_field.m
- Timestamp:
- May 28, 2013, 11:30:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plot_field.m
r625 r644 197 197 end 198 198 else %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);% 200 204 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); 202 206 AxeData.ZoomAxes=zoomaxes; 203 207 end 204 % if ~isempty(Coordinates)205 % PlotParamOut.Coordinates=Coordinates;206 % end207 208 PlotType='line'; 208 209 end … … 327 328 328 329 %------------------------------------------------------------------- 329 function CoordinatesOut=plot_profile(data,CellInfo,haxes,Coordinates )330 function CoordinatesOut=plot_profile(data,CellInfo,haxes,Coordinates,CheckHold) 330 331 %------------------------------------------------------------------- 331 332 333 %% initialization 332 334 if ~exist('Coordinates','var') 333 335 Coordinates=[]; … … 335 337 CoordinatesOut=Coordinates; %default 336 338 hfig=get(haxes,'parent'); 337 %suppress existing plot isf empty data 339 legend_str={}; 340 341 %% suppress existing plot if empty data 338 342 if isempty(data) 339 343 hplot=findobj(haxes,'tag','plot_line'); … … 348 352 end 349 353 354 %% set the colors of the successive plots (designed to produce rgb for the three components of color images) 350 355 ColorOrder=[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]; 351 356 set(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 360 if CheckHold 361 set(haxes,'NextPlot','add') 362 else 363 set(haxes,'NextPlot','replace') 364 end 358 365 359 366 %% prepare the string for plot command 360 367 plotstr='hhh=plot('; 361 coord_x_index=[];368 % coord_x_index=[]; 362 369 xtitle=''; 363 370 ytitle=''; 364 test_newplot= 1;371 test_newplot=~CheckHold; 365 372 MinX=[]; 366 373 MaxX=[]; … … 421 428 end 422 429 eval(['data.' VarName '=squeeze(data.' VarName ');']) 423 %eval(['min(data.' VarName ')'])424 430 MinY(ivar)=min(min(data.(VarName))); 425 431 MaxY(ivar)=max(max(data.(VarName))); … … 446 452 447 453 %% activate the plot 448 if test_newplot &&~isequal(plotstr,'hhh=plot(')454 if ~isequal(plotstr,'hhh=plot(') 449 455 set(hfig,'CurrentAxes',haxes) 450 456 tag=get(haxes,'tag');
Note: See TracChangeset
for help on using the changeset viewer.