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

📄 gedalayout.m

📁 常用ROBUST STATISTICAL
💻 M
字号:
function gedalayout
% 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     Handles to plot windows associated with this GUI.
%
% POPUPMENU
% H.popmode   Handle to popupmenu specifying coloring by groups. These would be the groups
%             loaded by the user. Think about expanding to include cluster ID groups.
%               {'None';'Color by groups';'Color by Cluster IDs'}
% H.data   Handle to popupmenu specifying the data to cluster. This will have to change
%             based on what user has done with other GUIS.
%             {'Data - X';'reduced data'}
%
% DIMENSIONS - EDIT BOXES
% H.dim2D     Handle to dimensions for 2D scatterplot
% H.dim3D     Handle to dimensions for 3D scatterplot
% H.dimscatter    Handle to dimensions for scatterplot matrix
% H.dimbrush  Handle to dimensions for brush/link scatterplot matrix
% H.dimparallel   Handle to dimensions for parallel coordinate plot
% H.dimandrews    Handle to dimensions for andrews curves plot

ud = get(0,'userdata');

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

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

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',[14 377 696 50]);

%%%%%%% 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','Graphical EDA')

uicontrol(H.fig,'style','text',...
    'position',[145 440 450 44],...
    'horizontalalignment','left',...
    'backgroundcolor',[.8 .8 .8],...
    'string','For all plots, indicate the dimensions you want to visualize and then press the button. The dimensions must be entered into the box separately by commas. Enter the word ''all'' to view all dimensions (except for 2D/3D scatterplots).')

% text in frame
uicontrol(H.fig,'style','text',...
    'position',[355 387 230 20],...
    'horizontalalignment','left',...
    'string','Select to color by true classes or clusters:')

uicontrol(H.fig,'style','text',...
    'position',[50 387 230 20],...
    'horizontalalignment','left',...
    'string','Select the data set to visualize:')

% Text to enter dimensions:

uicontrol(H.fig,'style','text',...
    'position',[50 325 182 21],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'backgroundcolor',[.8 .8 .8],...
    'string','Enter dimensions to display:')

uicontrol(H.fig,'style','text',...
    'position',[50 265 182 21],...
    'fontsize',9,...
    'horizontalalignment','left',...
     'backgroundcolor',[.8 .8 .8],...
    'string','Enter dimensions to display:')

uicontrol(H.fig,'style','text',...
    'position',[50 205 182 21],...
    'fontsize',9,...
    'horizontalalignment','left',...
     'backgroundcolor',[.8 .8 .8],...
    'string','Enter dimensions to display:')

uicontrol(H.fig,'style','text',...
    'position',[50 145 182 21],...
    'fontsize',9,...
    'horizontalalignment','left',...
     'backgroundcolor',[.8 .8 .8],...
    'string','Enter dimensions to display:')

uicontrol(H.fig,'style','text',...
    'position',[50 85 182 21],...
    'fontsize',9,...
    'horizontalalignment','left',...
     'backgroundcolor',[.8 .8 .8],...
    'string','Enter dimensions to display:')

uicontrol(H.fig,'style','text',...
    'position',[50 25 182 21],...
    'fontsize',9,...
    'horizontalalignment','left',...
     'backgroundcolor',[.8 .8 .8],...
    'string','Enter dimensions to display:')

% Text to push buttons:
uicontrol(H.fig,'style','text',...
    'position',[395 325 75 21],...
    'fontsize',9,...
    'horizontalalignment','left',...
    'backgroundcolor',[.8 .8 .8],...
    'string','Push to plot:')

uicontrol(H.fig,'style','text',...
    'position',[395 265 182 21],...
    'fontsize',9,...
    'horizontalalignment','left',...
     'backgroundcolor',[.8 .8 .8],...
    'string','Push to plot:')

uicontrol(H.fig,'style','text',...
    'position',[395 205 182 21],...
    'fontsize',9,...
    'horizontalalignment','left',...
     'backgroundcolor',[.8 .8 .8],...
    'string','Push to plot:')

uicontrol(H.fig,'style','text',...
    'position',[395 145 182 21],...
    'fontsize',9,...
    'horizontalalignment','left',...
     'backgroundcolor',[.8 .8 .8],...
    'string','Push to plot:')

uicontrol(H.fig,'style','text',...
    'position',[395 85 182 21],...
    'fontsize',9,...
    'horizontalalignment','left',...
     'backgroundcolor',[.8 .8 .8],...
    'string','Push to plot:')

uicontrol(H.fig,'style','text',...
    'position',[395 25 182 21],...
    'fontsize',9,...
    'horizontalalignment','left',...
     'backgroundcolor',[.8 .8 .8],...
    'string','Push to plot:')

%%%%%%% 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',[14 434 88 23],...
    'string','BRUSH DATA',...
    'tooltipstring','This will bring up the Brushing/Labeling Data GUI.',...
    'callback','brushgui')

% plot buttons
uicontrol(H.fig,'style','pushbutton',...
    'position',[486 328 200 25],...
    'string','2-D SCATTERPLOT',...
    'tooltipstring','This will produce a 2-D scatterplot.',...
    'callback','gedagui(''twodscatter'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[486 268 200 25],...
    'string','3-D SCATTERPLOT',...
    'tooltipstring','This will produce a 3-D scatterplot.',...
    'callback','gedagui(''threedscatter'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[486 210 200 25],...
    'string','SCATTERPLOT MATRIX',...
    'tooltipstring','This will produce a matrix of scatterplots.',...
    'callback','gedagui(''scattermat'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[486 150 200 25],...
    'string','SCATTERPLOT MATRIX - BRUSHING',...
    'tooltipstring','This will produce a scatterplot matrix for brushing and linking.',...
    'callback','gedagui(''brushlink'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[486 88 200 25],...
    'string','PARALLEL COORDINATES PLOT',...
    'tooltipstring','This will produce a parallel coordinates plot.',...
    'callback','gedagui(''parallel'')')

uicontrol(H.fig,'style','pushbutton',...
    'position',[486 28 200 25],...
    'string','ANDREWS'' CURVES PLOT',...
    'tooltipstring','This will produce an Andrews'' curves plot.',...
    'callback','gedagui(''andrews'')')



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

%%%%%%%     POPUPMENUS %%%%%%%%%%%%%%%%%%%%%%%  

H.popmode = uicontrol('style','popupmenu',...
    'String',{'None';'Color by groups';'Color by Cluster IDs'},...
    'position',[573 387 120 22],...
    'backgroundcolor','white');

H.data = uicontrol('style','popupmenu',...
    'String',ud.dimred,...
    'position',[210 387 100 22],...
    'backgroundcolor','white');


%%%%%%      EDIT BOXES  %%%%%%%%%%%%%%%%%%%%%%
H.dim2D = uicontrol('style','edit',...
    'string','1, 2',...
    'position',[220 327 82 22],...
    'backgroundcolor','white');

H.dim3D = uicontrol('style','edit',...
    'string','1, 2, 3',...
    'position',[220 268 82 22],...
    'backgroundcolor','white');

H.dimscatter = uicontrol('style','edit',...
    'string','all',...
    'position',[220 210 82 22],...
    'backgroundcolor','white');

H.dimbrush = uicontrol('style','edit',...
    'string','all',...
    'position',[220 150 82 22],...
    'backgroundcolor','white');

H.dimparallel = uicontrol('style','edit',...
    'string','all',...
    'position',[220 88 82 22],...
    'backgroundcolor','white');

H.dimandrews = uicontrol('style','edit',...
    'string','all',...
    'position',[220 28 82 22],...
    'backgroundcolor','white');

% 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 + -