⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tourslayout.m

📁 常用ROBUST STATISTICAL
💻 M
字号:
function tourslayout
% This function will layout the gui controls. Eventually, this will be
% included in the complete function. Just have it now for simplicity.

% First get the user data from the root. See if anything is stored there.
% H.fig       Handle to GUI figure window
% H.plots     Array of handles to the plot windows created with this gui
%
% GRAND TOUR
% H.gtstep    Handle to edit box for grand tour step size. Default is 0.01
% H.gtdim     Handle to edit box for grand tour display dimensions. Default is 2D scatterplot
% H.gtiter    Handle to edit box for grand tour max number of iterations in tour. Default is 1000
% H.gtdisplay     Handle to popupmenu for GT display type. 
%                 {'Scatterplot','Andrews curves','Parallel coords'});  
% H.gtcolflag     Handle to radio button to use (loaded) group colors or not.
%                
% PSEUDO GRAND TOUR
% H.psstep    Handle to edit box for pseudo GT step size.
% H.psiter    Handle to edit box for pseudo GT max number of iterations.
% H.pscolflag     Handle to radio button to use (loaded) group colors or not.
% 
% PERMUTATION TOUR
% H.permdisplay   Handle to popupmenu for permutation tour display type.
%                 {'Andrews','Parallel'});
% H.permtype      Handle to popupmenu for permutation tour type.
%                 {'All permutations','Minimal'});
% H.permcolflag   Handle to radio button to use (loaded) group colors or not.

ud = get(0,'userdata');

H.fig = figure('Tag','tourgui',...
    'position',[150 150 726 524],...
    'resize','off',...
    'toolbar','none',...
    'menubar','none',...
    'numbertitle','off',...
    'name','Data Tours GUI',...
    'CloseRequestFcn','tourgui(''close'')');

if strcmp(version('-release'),'14')
    set(0,'DefaultUicontrolFontname','Sans Serif');
end

% Keep track of GUI plots in this array. So, we can close when the gui is
% closed.

H.plots = [];

if ~isempty(ud)
    % Then something is there already. Add necessary handles to the
    % structure. 
    ud.guis = [ud.guis(:); H.fig];
else
    % Set the usual stuff and save in root.
    ud = userdata;
    set(0,'userdata',ud)
end

%%%%%%%  FRAMES %%%%%%%%%%%%%%%
% set up all of the frames first.
uicontrol(H.fig, 'style','frame',...
    'position',[21 306 680 140]);

uicontrol(H.fig, 'style','frame',...
    'position',[21 160 680 140]);

uicontrol(H.fig, 'style','frame',...
    'position',[21 15 680 140]);

%%%%%%% TEXT BOXES %%%%%%%%%%%%%%
% set up all of the text boxes
uicontrol(H.fig,'style','text',...
    'position',[170 485 330 27],...
    'fontweight','bold',...
    'fontsize',14,...
    'backgroundcolor',[.8 .8 .8],...
    'string','Data Tours')

% Title boxes
uicontrol(H.fig,'style','text',...
    'position',[40 405 80 34],...
    'fontweight','bold',...
    'fontsize',10,...
    'horizontalalignment','left',...
    'string','Grand Tour')

uicontrol(H.fig,'style','text',...
    'position',[40 260 80 34],...
    'fontweight','bold',...
    'fontsize',10,...
    'horizontalalignment','left',...
    'string','Pseudo Grand Tour')

uicontrol(H.fig,'style','text',...
    'position',[40 115 85 34],...
    'fontweight','bold',...
    'fontsize',10,...
    'horizontalalignment','left',...
    'string','Permutation Tour')

% Instruction text boxes:
uicontrol(H.fig,'style','text',...
    'position',[150 408 540 30],...
    'horizontalalignment','left',...
    'string','Implements Asimov''s torus grand tour. Can display 2 to p dimensions.')

uicontrol(H.fig,'style','text',...
    'position',[150 255 540 30],...
    'horizontalalignment','left',...
    'string','Implements Wegman''s psuedo grand tour. Only does 2D scatterplots.')

uicontrol(H.fig,'style','text',...
    'position',[150 95 275 50],...
    'horizontalalignment','left',...
    'string','Permutes the order of the variables and displays as either Andrews'' curves or in parallel coordinates.')

uicontrol(H.fig,'style','text',...
    'position',[150 450 450 35],...
    'horizontalalignment','left',...
    'backgroundcolor',[.8 .8 .8],...
    'string','Use these capabilities to explore projections of the data. All plots/graphics are animated and will be shown in a plot window.')

% Steps - text in frame 1
uicontrol(H.fig,'style','text',...
    'position',[40 362 120 32],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'string','1. Enter step size:')

uicontrol(H.fig,'style','text',...
    'position',[40 320 100 50],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'string','2. Number of dimensions to display:')

uicontrol(H.fig,'style','text',...
    'position',[205 355 120 40],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'string','3. Enter max iterations:')

uicontrol(H.fig,'style','text',...
    'position',[205 320 120 40],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'string','4. Select display type:')

uicontrol(H.fig,'style','text',...
    'position',[470 355 120 40],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'string','5. Push to:')

% Steps - text in frame 2
uicontrol(H.fig,'style','text',...
    'position',[40 215 230 16],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'string','1. Enter step size:')

uicontrol(H.fig,'style','text',...
    'position',[220 215 260 16],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'string','2. Enter max iterations:')

uicontrol(H.fig,'style','text',...
    'position',[470 215 150 16],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'string','3. Push to:')

% Steps - text in frame 3
uicontrol(H.fig,'style','text',...
    'position',[40 60 230 32],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'string','1. Select display:')

uicontrol(H.fig,'style','text',...
    'position',[215 60 312 32],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'string','2. Select type of tour:')

uicontrol(H.fig,'style','text',...
    'position',[470 60 150 32],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'string','3. Push to:')

%%%%%%% BUTTONS  %%%%%%%%%%%%%%%%%%%%   
uicontrol(H.fig,'style','pushbutton',...
    'position',[14 491 88 23],...
    'string','LOAD DATA',...
    'tooltipstring','This will bring up the Load Data GUI',...
    'callback','loadgui')

uicontrol(H.fig,'style','pushbutton',...
    'position',[14 463 88 23],...
    'string','TRANSFORM',...
    'tooltipstring','This will bring up the Transform Data GUI.',...
    'callback','transformgui')

%%%%%%%%%%%%%%%%%%

uicontrol(H.fig,'style','pushbutton',...
    'position',[560 370 130 25],...
    'string','OUTPUT DATA',...
    'tooltipstring','This will save the projected data to the workspace.',...
    'callback','tourgui(''gtdataout'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[560 335 130 25],...
    'string','OUTPUT PROJECTION',...
    'tooltipstring','This will save the projection matrix to the workspace.',...
    'callback','tourgui(''gtprojout'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[470 350 75 25],...
    'string','START',...
    'tooltipstring','This will start the Grand Tour.',...
    'callback','tourgui(''grandtour'')')

% uicontrol(H.fig,'style','pushbutton',...
%     'position',[470 335 75 25],...
%     'string','STOP',...
%     'tooltipstring','This will stop the tour.',...
%     'callback','')

%%%%%%%%%%%%%%%%%%%%%%%

uicontrol(H.fig,'style','pushbutton',...
    'position',[560 225 130 25],...
    'string','OUTPUT DATA',...
    'tooltipstring','This will save the projected data to the workspace.',...
    'callback','tourgui(''ptdataout'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[560 190 130 25],...
    'string','OUTPUT PROJECTION',...
    'tooltipstring','This will save the projection matrix to the workspace.',...
    'callback','tourgui(''ptprojout'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[470 185 75 25],...
    'string','START',...
    'tooltipstring','This will start the Pseudo Grand Tour.',...
    'callback','tourgui(''pseudotour'')')

% uicontrol(H.fig,'style','pushbutton',...
%     'position',[470 190 75 25],...
%     'string','STOP',...
%     'tooltipstring','This will stop the tour.',...
%     'callback','')

%%%%%%%%%%%%%%%%%%%%%%%
uicontrol(H.fig,'style','pushbutton',...
    'position',[470 50 75 25],...
    'string','START',...
    'tooltipstring','This will start the Permutation Tour.',...
    'callback','tourgui(''permtour'')')

% uicontrol(H.fig,'style','pushbutton',...
%     'position',[470 40 75 25],...
%     'string','STOP',...
%     'tooltipstring','This will stop the tour.',...
%     'callback','')

% Close button
uicontrol(H.fig,'style','pushbutton',...
    'position',[620 485 66 25],...
    'string','CLOSE',...
    'callback','tourgui(''close'')',...
    'tooltipstring','Push this button to close the GUI window.')


%%%%%%      EDIT BOXES  %%%%%%%%%%%%%%%%%%%%%%
% First frame
H.gtstep = uicontrol('style','edit',...
    'string','0.01',...
    'position',[150 375 50 22],...
    'backgroundcolor','white');

H.gtdim = uicontrol('style','edit',...
    'string','2',...
    'position',[150 338 50 22],...
    'backgroundcolor','white');

H.gtiter = uicontrol('style','edit',...
    'string','1000',...
    'position', [330 375 82 22] ,...
    'backgroundcolor','white');

% Second Frame  
H.psstep = uicontrol('style','edit',...
    'string','0.01',...
    'position',[150 215 60 22],...
    'backgroundcolor','white');

H.psiter = uicontrol('style','edit',...
    'string','1000',...
    'position',[355 215 60 22],...
    'backgroundcolor','white');


%%%%%%%%% POPUPMENU %%%%%%%%%%%%%%%%%

H.gtdisplay = uicontrol('style','popupmenu',...
    'position',[330 338 95 22],...
    'backgroundcolor','white',...
    'String',{'Scatterplot','Andrews curves','Parallel coords'},...
    'callback','tg=findobj(''tag'',''gt'');if ~isempty(tg),close(tg),end');

H.permdisplay = uicontrol('style','popupmenu',...
    'position',[135 70 75 22],...
    'backgroundcolor','white',...
    'String',{'Andrews','Parallel'});

H.permtype = uicontrol('style','popupmenu',...
    'position',[335 70 100 22],...
    'backgroundcolor','white',...
    'String',{'All permutations','Minimal'});

%%%%%%%%    RADIO BUTTON  %%%%%%%%%%%%%%%%
% H.gtcolflag = uicontrol('style','radio',...
%     'position',[550 415 100 30],...
%     'String','Use group colors',...
%     'tooltipstring','Plots points according to group colors');
% 
% H.pscolflag = uicontrol('style','radio',...
%     'position',[550 262 100 30],...
%     'String','Use group colors',...
%     'tooltipstring','Plots points according to group colors');

H.permcolflag = uicontrol('style','radio',...
    'position',[550 120 120 30],...
    'String','Use group colors',...
    'tooltipstring','Plots points according to group colors');


% Save Handles for THIS GUI in the UserData for this figure.
set(gcf,'userdata',H)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -