source: trunk/src/write_plot_param.m @ 589

Last change on this file since 589 was 589, checked in by sommeria, 8 years ago

various minor corrections made

File size: 4.2 KB
Line 
1%'write_plot_param': update the plotting parameters on the uvmat or view_field interface after a plotting operation
2function write_plot_param(handles,PlotParam)
3%% coordinates
4if isempty(PlotParam.Coordinates)
5    set(handles.Coordinates,'Visible','off')
6    set(handles.PlotAxes,'Visible','off')
7    set(handles.text_display,'Visible','off')
8    set(handles.TableDisplay,'Visible','on')
9else
10    set(handles.Coordinates,'Visible','on')
11    set(handles.PlotAxes,'Visible','on')
12    set(handles.text_display,'Visible','on')
13    if isfield(handles,'TableDisplay')
14    set(handles.TableDisplay,'Visible','off')
15    end
16    Coordinates=PlotParam.Coordinates;
17    if isfield(Coordinates,'CheckFixAspectRatio')
18        if Coordinates.CheckFixAspectRatio
19            set(handles.CheckFixAspectRatio,'Value',1)
20        else
21            set(handles.CheckFixAspectRatio,'Value',0)
22 
23        end
24    end
25    if isfield(Coordinates,'AspectRatio')
26        set(handles.num_AspectRatio,'String',num2str(Coordinates.AspectRatio))
27    end
28    if isfield(Coordinates,'MinX')
29        set(handles.num_MinX,'String',num2str(Coordinates.MinX,4));
30        set(handles.num_MaxX,'String',num2str(Coordinates.MaxX,4));
31        set(handles.num_MinY,'String',num2str(Coordinates.MinY,4));
32        set(handles.num_MaxY,'String',num2str(Coordinates.MaxY,4));
33    else
34        set(handles.num_MinX,'String','');
35        set(handles.num_MaxX,'String','');
36        set(handles.num_MinY,'String','');
37        set(handles.num_MaxY,'String','');
38    end
39end
40
41%% scalar or image parameters
42if isfield(PlotParam,'Scalar')
43    set(handles.Scalar,'Visible','on')
44    if isfield(PlotParam.Scalar,'MaxA')
45        set(handles.num_MaxA,'String',num2str(PlotParam.Scalar.MaxA,3));
46    end
47    if isfield(PlotParam.Scalar,'MinA')
48        set(handles.num_MinA,'String',num2str(PlotParam.Scalar.MinA,3));
49    end   
50    if isfield(PlotParam.Scalar,'IncrA')
51        set(handles.num_IncrA,'String',num2str(PlotParam.Scalar.IncrA,3))
52    end
53    set(handles.CheckBW,'Value',PlotParam.Scalar.CheckBW)
54    if isfield(PlotParam.Scalar,'Opacity')&&isfield(handles,'num_Opacity')
55        set(handles.num_Opacity,'String',num2str(PlotParam.Scalar.Opacity))
56    end
57else
58    set(handles.Scalar,'Visible','off')
59end
60
61%% parameter for vector field
62if isfield(PlotParam,'Vectors')
63    set(handles.Vectors,'Visible','on')
64    if isfield(PlotParam.Vectors,'VecScale')
65        set(handles.num_VecScale,'String',num2str(PlotParam.Vectors.VecScale,3))
66    end
67    if isfield(PlotParam.Vectors,'MinC')&& isfield(PlotParam.Vectors,'MaxC')
68        MinC=PlotParam.Vectors.MinC;
69        MaxC=PlotParam.Vectors.MaxC;
70        set(handles.num_MinVec,'String', num2str(MinC,3));
71        set(handles.num_MaxVec,'String',num2str(MaxC,3));
72        list=get(handles.ColorCode,'String');
73        ichoice=get(handles.ColorCode,'Value');
74        color_option=list{ichoice};
75        test3color=strcmp(color_option,'rgb')||strcmp(color_option,'bgr');
76        if test3color% need to update color thresholds
77            set(handles.num_ColCode1,'Visible','on')
78            set(handles.num_ColCode2,'Visible','on')
79            set(handles.Slider1,'Visible','on')
80            set(handles.Slider2,'Visible','on')
81            %ColCode1=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode1;
82            %ColCode2=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode2;
83%             ColCode1=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode1;
84            %ColCode2=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode2;
85            set(handles.num_ColCode1,'String',num2str(PlotParam.Vectors.ColCode1,3))
86            set(handles.num_ColCode2,'String',num2str(PlotParam.Vectors.ColCode2,3))
87            set(handles.Slider1,'Value',(PlotParam.Vectors.ColCode1-MinC)/(MaxC-MinC))
88            set(handles.Slider2,'Value',(PlotParam.Vectors.ColCode2-MinC)/(MaxC-MinC))
89        else
90            set(handles.num_ColCode1,'Visible','off')
91            set(handles.num_ColCode2,'Visible','off')
92            set(handles.Slider1,'Visible','off')
93            set(handles.Slider2,'Visible','off')
94        end
95    end
96else
97    set(handles.Vectors,'Visible','off')
98    if isfield(handles,'edit_vect')
99        set(handles.edit_vect,'Visible','off')
100        set(handles.record,'Visible','off')
101    end
102end
Note: See TracBrowser for help on using the repository browser.