Home > . > read_plot_param.m

# read_plot_param

## PURPOSE

'read_plot_param': read plotting parameters from the interface uvmat

## SYNOPSIS

function PlotParam=read_plot_param(handles)

## DESCRIPTION

    'read_plot_param':  read plotting parameters from the interface uvmat
    ------------------------------------------
     function PlotParam=read_plot_param(handles)

     OUTPUT:
     PlotParam: structure containing the values of all the relevant plotting parameters

     INPUT:
     handles: structure containing the handles of the relevant uicontrols in the uvmat interface

          -- TODO:   get the handles using get_plot_handles and findobj as  default input --

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

- plot_field 'plot_field': plot any field with the structure defined in the uvmat package
- uvmat 'uvmat': function associated with the GUI 'uvmat.fig' for images and data field visualization

## SOURCE CODE

    0001 %'read_plot_param':  read plotting parameters from the interface uvmat
    0002 %------------------------------------------
    0003 % function PlotParam=read_plot_param(handles)
    0004 %
    0005 % OUTPUT:
    0006 % PlotParam: structure containing the values of all the relevant plotting parameters
    0007 %
    0008 % INPUT:
    0009 % handles: structure containing the handles of the relevant uicontrols in the uvmat interface
    0010 %
    0011 %      -- TODO:   get the handles using get_plot_handles and findobj as  default input --
    0012
    0013 function PlotParam=read_plot_param(handles)
    0014
    0015 PlotParam.Auto_xy=get(handles.auto_xy,'Value');
    0016
    0017 % scalars
    0018 Scalar.MaxA=str2double(get(handles.MaxA,'String'));
    0019 Scalar.MinA=str2double(get(handles.MinA,'String'));
    0020 Scalar.AutoScal=get(handles.AutoScal,'Value');
    0021 Scalar.BW=get(handles.BW,'Value');
    0022 Scalar.Contours=get(handles.Contours,'Value')==2;
    0023 Scalar.IncrA=str2double(get(handles.IncrA,'String'));
    0024 PlotParam.Scalar=Scalar;
    0025
    0026 %vectors
    0027 Vectors.VecScale=str2double(get(handles.VecScale,'String'));
    0028 Vectors.AutoVec=get(handles.AutoVec,'Value');%automatic vector length
    0029 Vectors.HideFalse=get(handles.HideFalse,'Value');
    0030 Vectors.HideWarning=get(handles.HideWarning,'Value');
    0031 Vectors.decimate4=get(handles.decimate4,'Value');% =1; for reducing the nbre of vectors
    0032
    0033 %vector color
    0034 code_list=get(handles.color_code,'String');
    0035 val=get(handles.color_code,'Value');
    0036 % menu_col=get(handles.col_vec,'String');
    0037 % menu_val=get(handles.col_vec,'Value');
    0038 colcode1=str2double(get(handles.colcode1,'String'));% first threshold for rgb, first value for'continuous'
    0039 colcode2=str2double(get(handles.colcode2,'String'));% second threshold for rgb, last value (saturation) for 'continuous'
    0040
    0041 Vectors.ColorCode=code_list{val}; % option of color code for vectors
    0042 Vectors.FixedCbounds=get(handles.AutoVecColor,'Value');% =1; fixed scale for color vector, =0 otherwise (default)
    0043 Vectors.MinC=str2num(get(handles.min_vec,'String')); % imposed min of C, (needed if .FixedCbounds=1)
    0044 Vectors.MaxC=str2num(get(handles.max_vec,'String')); % imposed max of C, needed if .FixedCbounds=1
    0045 if Vectors.MaxC <= Vectors.MinC
    0046     Vectors.ColorCode='black';
    0047 else
    0048     Vectors.colcode1=Vectors.MinC+(colcode1-Vectors.MinC)/(Vectors.MaxC-Vectors.MinC);% relative thresholds
    0049     Vectors.colcode2=Vectors.MinC+(colcode2-Vectors.MinC)/(Vectors.MaxC-Vectors.MinC);
    0050 end
    0051 PlotParam.Vectors=Vectors;
    0052