恢復編程結構
此代碼建立一個圖形,其頂部面板包含一個軸,底部面板包含一個按鈕和彈出菜單。
hf = figure;
hb = uicontrol('Style','PushButton',...
'String','Plot',...
'Position',[175, 40, 60, 25]);
hpulabel = uicontrol('Style','text',...
'String', 'Plot Type',...
'Position', [300, 65, 60, 20]);
hpu = uicontrol('Style', 'popupmenu',...
'String', {'bar', 'plot', 'stem'},...
'Position',[310, 40, 60, 25]);
topp = uipanel('Title', 'Plot',...
'Position',[0 .25 1 .75]);
ah = axes('Position', [.10, .35 .80 .60]);
bottomp = uipanel('Title','Plotting Options',...
'Position',[0 0 1 .25]);
ENDhf = figure;
topph = uipanel('Parent', hf,'Title', 'Plot',...
'Position',[0 .25 1 .75]);
axes('Parent', topph, 'Position', [.10, .35 .80 .60]);
bottomph = uipanel('Parent', hf,'Title','Plotting Options',...
'Position',[0 0 1 .25])
hpulabel = uicontrol('Parent', bottomph, 'Style','text',...
'String', 'Plot Type',...
'Position', [300, 65, 60, 20]);
hb = uicontrol('Parent', bottomph, 'Style','PushButton',...
'String','Plot',...
'Position',[175, 40, 60, 25]);
hpu = uicontrol('Parent', bottomph, 'Style', 'popupmenu',...
'String', {'bar', 'plot', 'stem'},...
'Position',[310, 40, 60, 25]);
END0 篇文章
如果覺得我的文章對您有用,請隨意打賞。你的支持將鼓勵我繼續創作!