source: trunk/src/write_plot_param.m @ 313

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

bug reapirs in view of vector colors and grid in civ

File size: 3.3 KB
Line 
1%'write_plot_param': update the plotting parameters on the uvmat interface after a plotting operation
2function write_plot_param(handles,PlotParam)
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));
20    else
21        set(handles.num_MinX,'String','');
22        set(handles.num_MaxX,'String','');
23        set(handles.num_MinY,'String','');
24        set(handles.num_MaxY,'String','');
25    end
26end
27
28%% scalar or image parameters
29if isfield(PlotParam,'Scalar')
30    set(handles.Scalar,'Visible','on')
31    if isfield(PlotParam.Scalar,'MaxA')
32        set(handles.num_MaxA,'String',num2str(PlotParam.Scalar.MaxA,3));
33    end
34    if isfield(PlotParam.Scalar,'MinA')
35        set(handles.num_MinA,'String',num2str(PlotParam.Scalar.MinA,3));
36    end
37   
38    if isfield(PlotParam.Scalar,'IncrA')
39        set(handles.num_IncrA,'String',num2str(PlotParam.Scalar.IncrA,3))
40    end
41else
42    set(handles.Scalar,'Visible','off')
43end
44
45%% parameter for vector field
46if isfield(PlotParam,'Vectors')
47    set(handles.Vectors,'Visible','on')
48    if isfield(PlotParam.Vectors,'VecScale')
49        set(handles.num_VecScale,'String',num2str(PlotParam.Vectors.VecScale,3))
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.num_MinVec,'String', num2str(MinC,3));
55        set(handles.num_MaxVec,'String',num2str(MaxC,3));
56        list=get(handles.ListColorCode,'String');
57        ichoice=get(handles.ListColorCode,'Value');
58        color_option=list{ichoice};
59        test3color=strcmp(color_option,'rgb')||strcmp(color_option,'bgr');
60        if test3color% need to update color thresholds
61            set(handles.num_ColCode1,'Visible','on')
62            set(handles.num_ColCode2,'Visible','on')
63            set(handles.Slider1,'Visible','on')
64            set(handles.Slider2,'Visible','on')
65            ColCode1=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode1;
66            ColCode2=MinC+(MaxC-MinC)*PlotParam.Vectors.ColCode2;
67            set(handles.num_ColCode1,'String',num2str(ColCode1,3))
68            set(handles.num_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.num_ColCode1,'Visible','off')
73            set(handles.num_ColCode2,'Visible','off')
74            set(handles.Slider1,'Visible','off')
75            set(handles.Slider2,'Visible','off')
76        end
77    end
78else
79    set(handles.Vectors,'Visible','off')
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.