source: trunk/src/write_plot_param.m @ 339

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

bug reapirs in view of vector colors and grid in civ

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;
[313]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');
[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
[313]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)
[204]71        else
[313]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')
[204]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.