Changeset 748 for trunk/src/plot_field.m


Ignore:
Timestamp:
Apr 23, 2014, 4:57:58 PM (10 years ago)
Author:
sommeria
Message:

update for 3D plots, panel Coordiantes introduces, while coordiantes now called Axes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_field.m

    r735 r748  
    4545%   PlotParam: structure containing the parameters for plotting, as read on the uvmat or view_field GUI (by function 'read_GUI.m').
    4646%      Contains three substructures:
    47 %     .Coordinates: coordinate parameters:
     47%     .Axes: coordinate parameters:
    4848%           .CheckFixLimits:=0 (default) adjust axes limit to the X,Y data, =1: preserves the previous axes limits
    49 %     .Coordinates.CheckFixAspectRatio: =0 (default):automatic adjustment of the graph, keep 1 to 1 aspect ratio for x and y scales.
    50 %     .Coordinates.AspectRatio: imposed aspect ratio y/x of axis unit plots
     49%     .Axes.CheckFixAspectRatio: =0 (default):automatic adjustment of the graph, keep 1 to 1 aspect ratio for x and y scales.
     50%     .Axes.AspectRatio: imposed aspect ratio y/x of axis unit plots
    5151%            --scalars--
    5252%    .Scalar.MaxA: upper bound (saturation color) for the scalar representation, max(field) by default
     
    103103PlotType='text'; %default
    104104if ~isfield(PlotParam,'Coordinates')
    105     PlotParam.Coordinates=[];
     105    PlotParam.Axes=[];
    106106    if isfield(Data,'CoordUnit')
    107         PlotParam.Coordinates.CheckFixAspectRatio=1;
    108         PlotParam.Coordinates.AspectRatio=1; %set axes equal by default if CoordUnit is defined
     107        PlotParam.Axes.CheckFixAspectRatio=1;
     108        PlotParam.Axes.AspectRatio=1; %set axes equal by default if CoordUnit is defined
    109109    end
    110110end
     
    160160
    161161%% set axes properties
    162 if isfield(PlotParamOut.Coordinates,'CheckFixLimits') && isequal(PlotParamOut.Coordinates.CheckFixLimits,1)  %adjust the graph limits
     162if isfield(PlotParamOut.Axes,'CheckFixLimits') && isequal(PlotParamOut.Axes.CheckFixLimits,1)  %adjust the graph limits
    163163    set(haxes,'XLimMode', 'manual')
    164164    set(haxes,'YLimMode', 'manual')
     
    193193        CheckHold= PlotParam.CheckHold;
    194194    end       
    195     PlotParamOut.Coordinates=plot_profile(Data,CellInfo(index_1D),haxes,PlotParamOut.Coordinates,CheckHold);%
     195    PlotParamOut.Axes=plot_profile(Data,CellInfo(index_1D),haxes,PlotParamOut.Axes,CheckHold);%
    196196    if testzoomaxes
    197         [zoomaxes,PlotParamOut.Coordinates]=plot_profile(Data,CellInfo(index_1D),zoomaxes,PlotParamOut.Coordinates,CheckHold);
     197        [zoomaxes,PlotParamOut.Axes]=plot_profile(Data,CellInfo(index_1D),zoomaxes,PlotParamOut.Axes,CheckHold);
    198198        AxeData.ZoomAxes=zoomaxes;
    199199    end
     
    897897            end
    898898           
    899             if isfield(PlotParam.Coordinates,'CheckFixAspectRatio') && isequal(PlotParam.Coordinates.CheckFixAspectRatio,1)
     899            if isfield(PlotParam.Axes,'CheckFixAspectRatio') && isequal(PlotParam.Axes.CheckFixAspectRatio,1)
    900900                set(haxes,'DataAspectRatioMode','manual')
    901                 if isfield(PlotParam.Coordinates,'AspectRatio')
    902                     set(haxes,'DataAspectRatio',[PlotParam.Coordinates.AspectRatio 1 1])
     901                if isfield(PlotParam.Axes,'AspectRatio')
     902                    set(haxes,'DataAspectRatio',[PlotParam.Axes.AspectRatio 1 1])
    903903                else
    904904                    set(haxes,'DataAspectRatio',[1 1 1])
     
    11671167    MinY=[];
    11681168    MaxY=[];
    1169     fix_lim=isfield(PlotParam.Coordinates,'CheckFixLimits') && PlotParam.Coordinates.CheckFixLimits;
     1169    fix_lim=isfield(PlotParam.Axes,'CheckFixLimits') && PlotParam.Axes.CheckFixLimits;
    11701170    if fix_lim
    1171         if isfield(PlotParam.Coordinates,'MinX')&&isfield(PlotParam.Coordinates,'MaxX')&&isfield(PlotParam.Coordinates,'MinY')&&isfield(PlotParam.Coordinates,'MaxY')
    1172             MinX=PlotParam.Coordinates.MinX;
    1173             MaxX=PlotParam.Coordinates.MaxX;
    1174             MinY=PlotParam.Coordinates.MinY;
    1175             MaxY=PlotParam.Coordinates.MaxY;
     1171        if isfield(PlotParam.Axes,'MinX')&&isfield(PlotParam.Axes,'MaxX')&&isfield(PlotParam.Axes,'MinY')&&isfield(PlotParam.Axes,'MaxY')
     1172            MinX=PlotParam.Axes.MinX;
     1173            MaxX=PlotParam.Axes.MaxX;
     1174            MinY=PlotParam.Axes.MinY;
     1175            MaxY=PlotParam.Axes.MaxY;
    11761176        end  %else PlotParamOut.MinX =PlotParam.MinX...
    11771177    else
     
    11941194        end
    11951195    end
    1196     PlotParamOut.Coordinates.MinX=MinX;
    1197     PlotParamOut.Coordinates.MaxX=MaxX;
    1198     PlotParamOut.Coordinates.MinY=MinY;
    1199     PlotParamOut.Coordinates.MaxY=MaxY;
     1196    PlotParamOut.Axes.MinX=MinX;
     1197    PlotParamOut.Axes.MaxX=MaxX;
     1198    PlotParamOut.Axes.MinY=MinY;
     1199    PlotParamOut.Axes.MaxY=MaxY;
    12001200    if MaxX>MinX
    12011201        set(haxes,'XLim',[MinX MaxX]);% set x limits of frame in axes coordinates
     
    12071207    set(get(haxes,'XLabel'),'String',[XName ' (' x_units ')']);
    12081208    set(get(haxes,'YLabel'),'String',[YName ' (' y_units ')']);
    1209     PlotParamOut.Coordinates.x_units=x_units;
    1210     PlotParamOut.Coordinates.y_units=y_units;
    1211 end
    1212 if isfield(PlotParam,'Coordinates') && isfield(PlotParam.Coordinates,'CheckFixAspectRatio') && isequal(PlotParam.Coordinates.CheckFixAspectRatio,1)
     1209    PlotParamOut.Axes.x_units=x_units;
     1210    PlotParamOut.Axes.y_units=y_units;
     1211end
     1212if isfield(PlotParam,'Coordinates') && isfield(PlotParam.Axes,'CheckFixAspectRatio') && isequal(PlotParam.Axes.CheckFixAspectRatio,1)
    12131213    set(haxes,'DataAspectRatioMode','manual')
    1214     if isfield(PlotParam.Coordinates,'AspectRatio')
    1215         set(haxes,'DataAspectRatio',[PlotParam.Coordinates.AspectRatio 1 1])
     1214    if isfield(PlotParam.Axes,'AspectRatio')
     1215        set(haxes,'DataAspectRatio',[PlotParam.Axes.AspectRatio 1 1])
    12161216    end
    12171217else
Note: See TracChangeset for help on using the changeset viewer.