Changeset 131 for trunk/src/plot_field.m


Ignore:
Timestamp:
Nov 25, 2010, 9:42:34 AM (13 years ago)
Author:
sommeria
Message:

bug repair for scalar image update, systematic replacement of command axes(haxes), replaced by
set(0, 'CurrentFigure?', hfig)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r128 r131  
    139139    end
    140140end
    141 
     141if isfield(PlotParam,'text_display_1') && ishandle(PlotParam.text_display_1)
     142    PlotParam=read_plot_param(PlotParam);   
     143end
    142144if testnewfig% create a new figure and axes if the plotting axes does not exist
    143145    hfig=figure;
     
    158160    haxes=axes;
    159161    set(haxes,'position',[0.13,0.2,0.775,0.73])
    160 end
    161 if isfield(PlotParam,'text_display_1') && ishandle(PlotParam.text_display_1)
    162     PlotParam=read_plot_param(PlotParam);   
    163 end
    164 if testnewfig
    165   PlotParam.NextPlot='add'; %parameter for plot_profile and plot_hist
    166 end
     162     PlotParam.NextPlot='add'; %parameter for plot_profile and plot_his
     163else
     164    hfig=get(haxes,'parent');
     165    set(0,'CurrentFigure',hfig)
     166    set(hfig,'CurrentAxes',haxes)
     167end
     168
    167169if isfield(PlotParam,'Auto_xy') && isequal(PlotParam.Auto_xy,1)
    168170    set(haxes,'DataAspectRatioMode','auto')%automatic aspect ratio
     
    428430if test_newplot && ~isequal(plotstr,'hhh=plot(')
    429431    plotstr=[plotstr '''tag'',''plot_line'');'];
    430                 %execute plot (instruction  plotstr) 
    431     axes(haxes)% select the plotting axes for plot operation
     432                %execute plot (instruction  plotstr)
     433%     set(hfig,'CurrentAxes',haxes)
     434%     axes(haxes)% select the plotting axes for plot operation
    432435    eval(plotstr)
    433436   
     
    758761            x_cont=AX(1):sizpx:AX(end); % pixel x coordinates for image display
    759762            y_cont=AY(1):-sizpy:AY(end); % pixel x coordinates for image display
     763           % axes(haxes)% set the input axes handle as current axis
    760764            txt=ver;%version of Matlab
    761765            Release=txt(1).Release;
     
    828832        if isempty(hima)
    829833           % axes(haxes)% set haxes the current axes for image creation
    830             set(hfig,'CurrentAxes',haxes) % set haxes the current axes for image creation
     834         %   set(hfig,'CurrentAxes',haxes) % set haxes the current axes for image creation
    831835            tag=get(haxes,'Tag');
    832836            if MinA<MaxA
     
    841845            set(hima,'CData',B);
    842846            if MinA<MaxA
    843                 caxis([MinA MaxA])
     847                set(haxes,'CLim',[MinA MaxA])
     848                %caxis([MinA MaxA])
    844849            else
    845                 caxis([MaxA-1 MaxA])
     850                set(haxes,'CLim',[MinA MaxA])
     851                %caxis([MaxA-1 MaxA])
    846852            end
    847853            set(hima,'XData',AX);
     
    11691175    if 2*icolor > sizh(1) %if icolor exceeds the number of existing ones
    11701176        %axes(haxes)
    1171         hfig=get(haxes,'parent');
     1177      %  hfig=get(haxes,'parent');
    11721178%         axes(haxes)
    1173         set(0,'CurrentFigure',hfig)
    1174         set(hfig,'CurrentAxes',haxes)
     1179      %  set(0,'CurrentFigure',hfig)
     1180       % set(hfig,'CurrentAxes',haxes)
    11751181        if ~isn(1) %if the vectors are visible color not nan
    11761182            if n(2)>0
Note: See TracChangeset for help on using the changeset viewer.