MATLAB: R2014b uipanel not showing on figure.

guimatlab gui

My uipanel is not showing up on the figure no matter what I do. I have no idea what I am doing wrong. I tried googling without success.
ComponentHeight = 60;
GUIheight = 13 * ComponentHeight;
SettingsPanelWidth = 1000;
SettingsPanelHeight = 500;
SettingsPanelPosition = [AlarmGatePosition(1), AlarmGatePosition(2)-50-SettingsPanelHeight, SettingsPanelWidth, SettingsPanelHeight];
f = figure('Name', 'AlarmGate Settings', ...
'NumberTitle', 'off', ...
'Color', 'w',...
'Units', 'pixels',...
'ToolBar', 'none',...
'HandleVisibility', 'on',...
'Position', SettingsPanelPosition,...
'Resize', 'off',...
'Tag', 'AlarmGateSettings',...
'MenuBar', 'none');
infoPanelPosition = [50, SettingsPanelHeight*0.5, SettingsPanelWidth*0.6, SettingsPanelHeight*.45];
infoPanel = uipanel('Parent', f,...
'Title', 'Recipients',...
'TitlePosition', 'lefttop',...
'Tag', 'infoPanel',...
'Position', infoPanelPosition,...
'Units','pixels',...
'BackgroundColor','blue',...
'FontSize', 12,...
'Visible', 'on',...
'HandleVisibility', 'on'...
);
uistack(infoPanel, 'top')

Best Answer

You need to define Units ahead of Position else the Position will be interpreted in default units (which are 'normalized') before the Units then get set to Pixels:
infoPanel = uipanel('Parent', f,...
'Title', 'Recipients',...
'TitlePosition', 'lefttop',...
'Tag', 'infoPanel',...
'Units','pixels',...
'Position', infoPanelPosition,...
'BackgroundColor','blue',...
'FontSize', 12,...
'Visible', 'on',...
'HandleVisibility', 'on'...
);