source: trunk/src/write_plot_param.m @ 295

Last change on this file since 295 was 295, checked in by sommeria, 9 years ago

plotting functions debugged and checked after the introduction of uipanels

File size: 3.3 KB
RevLine 
[204]1%'write_plot_param': update the plotting parameters on the uvmat interface after a plotting operation
2function write_plot_param(handles,PlotParam)
[295]3%% coordinates
4if isfield(PlotParam,'Coordinates')
5    Coordinates=PlotParam.Coordinates;
6    if isfield(Coordinates,'CheckFixEqual')
7        if Coordinates.CheckFixEqual
8            set(handles.CheckFixEqual,'Value',1)
9            set(handles.CheckFixEqual,'BackgroundColor',[1 1 0])
10        else
11            set(handles.CheckFixEqual,'Value',0)
12            set(handles.CheckFixEqual,'BackgroundColor',[0.7 0.7 0.7])
13        end
14    end
15    if isfield(Coordinates,'MinX')
16        set(handles.num_MinX,'String',num2str(Coordinates.MinX,4));
17        set(handles.num_MaxX,'String',num2str(Coordinates.MaxX,4));
18        set(handles.num_MinY,'String',num2str(Coordinates.MinY,4));
19        set(handles.num_MaxY,'String',num2str(Coordinates.MaxY,4));
[204]20    else
[295]21        set(handles.num_MinX,'String','');
22        set(handles.num_MaxX,'String','');
23        set(handles.num_MinY,'String','');
24        set(handles.num_MaxY,'String','');
[204]25    end
26end
27
[295]28%% scalar or image parameters
[204]29if isfield(PlotParam,'Scalar')
[295]30    set(handles.Scalar,'Visible','on')
[204]31    if isfield(PlotParam.Scalar,'MaxA')
[292]32        set(handles.num_MaxA,'String',num2str(PlotParam.Scalar.MaxA,3));
[204]33    end
34    if isfield(PlotParam.Scalar,'MinA')
[292]35        set(handles.num_MinA,'String',num2str(PlotParam.Scalar.MinA,3));
[204]36    end
[295]37   
[204]38    if isfield(PlotParam.Scalar,'IncrA')
[292]39        set(handles.num_IncrA,'String',num2str(PlotParam.Scalar.IncrA,3))
[204]40    end
41else
[295]42    set(handles.Scalar,'Visible','off')
[204]43end
44
[295]45%% parameter for vector field
[204]46if isfield(PlotParam,'Vectors')
[295]47    set(handles.Vectors,'Visible','on')
[204]48    if isfield(PlotParam.Vectors,'VecScale')
[292]49        set(handles.num_VecScale,'String',num2str(PlotParam.Vectors.VecScale,3))
[204]50    end
51    if isfield(PlotParam.Vectors,'MinC')&& isfield(PlotParam.Vectors,'MaxC')
52        MinC=PlotParam.Vectors.MinC;
53        MaxC=PlotParam.Vectors.MaxC;
54        set(handles.min_vec,'String', num2str(MinC,3));
55        set(handles.max_vec,'String',num2str(MaxC,3));
56        list=get(handles.color_code,'String');
57        ichoice=get(handles.color_code,'Value');
[295]58        color_option=list{ichoice};
[204]59        test3color=strcmp(color_option,'rgb')||strcmp(color_option,'bgr');
60        if test3color% need to update color thresholds
61            set(handles.colcode1,'Visible','on')
62            set(handles.colcode2,'Visible','on')
63            set(handles.slider1,'Visible','on')
64            set(handles.slider2,'Visible','on')
[295]65            colcode1=MinC+(MaxC-MinC)*PlotParam.Vectors.colcode1;
66            colcode2=MinC+(MaxC-MinC)*PlotParam.Vectors.colcode2;
[204]67            set(handles.colcode1,'String',num2str(colcode1,3))
68            set(handles.colcode2,'String',num2str(colcode2,3))
69            set(handles.slider1,'Value',PlotParam.Vectors.colcode1)
70            set(handles.slider2,'Value',PlotParam.Vectors.colcode2)
71        else
72            set(handles.colcode1,'Visible','off')
73            set(handles.colcode2,'Visible','off')
74            set(handles.slider1,'Visible','off')
75            set(handles.slider2,'Visible','off')
76        end
77    end
78else
[295]79    set(handles.Vectors,'Visible','off')
[204]80    if isfield(handles,'edit_vect')
81        set(handles.edit_vect,'Visible','off')
82        set(handles.record,'Visible','off')
83    end
84end
Note: See TracBrowser for help on using the repository browser.