figure resize behavior control: from bottom or from top
Hi, I encountered a problem when I resized a figure: The aim of resizing is to manually drag the top/bottom boundary to adjust the panel size, in order to hide the label and only show the buttons. However, the reality is that no matter where I drag, it is the top space hidden, but the space between the label and bottom remains constant. I can only hide the buttons or hide the buttons and label together, but I cannot find a way to resize to keep the bottom. Is there a way to reverse the direction of resizing?
fig = figure(‘Name’,’GUI with Buttons and Labels’,’NumberTitle’,’off’,’Position’,[100 100 400 300]);
% Create buttons
btn1 = uicontrol(fig,’Style’,’pushbutton’,’String’,’Button 1′,’Position’,[50 200 100 30]);
btn2 = uicontrol(fig,’Style’,’pushbutton’,’String’,’Button 2′,’Position’,[150 200 100 30]);
btn3 = uicontrol(fig,’Style’,’pushbutton’,’String’,’Button 3′,’Position’,[250 200 100 30]);
% Create labels
lbl1 = uicontrol(fig,’Style’,’text’,’String’,’Label 1′,’Position’,[50 150 100 30]);
lbl2 = uicontrol(fig,’Style’,’text’,’String’,’Label 2′,’Position’,[150 150 100 30]);
lbl3 = uicontrol(fig,’Style’,’text’,’String’,’Label 3′,’Position’,[250 150 100 30]);Hi, I encountered a problem when I resized a figure: The aim of resizing is to manually drag the top/bottom boundary to adjust the panel size, in order to hide the label and only show the buttons. However, the reality is that no matter where I drag, it is the top space hidden, but the space between the label and bottom remains constant. I can only hide the buttons or hide the buttons and label together, but I cannot find a way to resize to keep the bottom. Is there a way to reverse the direction of resizing?
fig = figure(‘Name’,’GUI with Buttons and Labels’,’NumberTitle’,’off’,’Position’,[100 100 400 300]);
% Create buttons
btn1 = uicontrol(fig,’Style’,’pushbutton’,’String’,’Button 1′,’Position’,[50 200 100 30]);
btn2 = uicontrol(fig,’Style’,’pushbutton’,’String’,’Button 2′,’Position’,[150 200 100 30]);
btn3 = uicontrol(fig,’Style’,’pushbutton’,’String’,’Button 3′,’Position’,[250 200 100 30]);
% Create labels
lbl1 = uicontrol(fig,’Style’,’text’,’String’,’Label 1′,’Position’,[50 150 100 30]);
lbl2 = uicontrol(fig,’Style’,’text’,’String’,’Label 2′,’Position’,[150 150 100 30]);
lbl3 = uicontrol(fig,’Style’,’text’,’String’,’Label 3′,’Position’,[250 150 100 30]); Hi, I encountered a problem when I resized a figure: The aim of resizing is to manually drag the top/bottom boundary to adjust the panel size, in order to hide the label and only show the buttons. However, the reality is that no matter where I drag, it is the top space hidden, but the space between the label and bottom remains constant. I can only hide the buttons or hide the buttons and label together, but I cannot find a way to resize to keep the bottom. Is there a way to reverse the direction of resizing?
fig = figure(‘Name’,’GUI with Buttons and Labels’,’NumberTitle’,’off’,’Position’,[100 100 400 300]);
% Create buttons
btn1 = uicontrol(fig,’Style’,’pushbutton’,’String’,’Button 1′,’Position’,[50 200 100 30]);
btn2 = uicontrol(fig,’Style’,’pushbutton’,’String’,’Button 2′,’Position’,[150 200 100 30]);
btn3 = uicontrol(fig,’Style’,’pushbutton’,’String’,’Button 3′,’Position’,[250 200 100 30]);
% Create labels
lbl1 = uicontrol(fig,’Style’,’text’,’String’,’Label 1′,’Position’,[50 150 100 30]);
lbl2 = uicontrol(fig,’Style’,’text’,’String’,’Label 2′,’Position’,[150 150 100 30]);
lbl3 = uicontrol(fig,’Style’,’text’,’String’,’Label 3′,’Position’,[250 150 100 30]); figure, resize MATLAB Answers — New Questions