function domainpnl(h,f)

%% Build time panel
if ~isempty(h.Plot)
    xlim = h.Plot.AxesGrid.getxlim(1);
else % Default time limits - no timeplot yet
    xlim = [0 1];
end
h.Handles.PNLDomain = uibuttongroup('Parent',f,'Units','Pixels','Title', ...
    'Define Histogram Bins','SelectionChangeFcn',@(es,ed) updatebins(h));

%% Build domain panel components
h.Handles.RADIOuniform = uicontrol('Style','Radiobutton','HorizontalAlignment','Left',...
    'Parent',h.Handles.PNLDomain,'String','Uniform centers','Units','Pixels', ...
    'Position',[15 52 113 15],'Value',1);
LBLNumBins = uicontrol('Style','Text','String','Number of bins','HorizontalAlignment',...
    'Left','Parent',h.Handles.PNLDomain,'Units','Pixels','Position',[137 50 103 17]);
h.Handles.TXTNumBins = uicontrol('Style','Edit','Parent',h.Handles.PNLDomain,'Units','Pixels', ...
    'Position',[233 48 168 21],'String','50','Callback', ...
    @(es,ed) updatebins(h),'HorizontalAlignment','Left','BackgroundColor',[1 1 1]);
h.Handles.RADIOcustom = uicontrol('Style','Radiobutton','HorizontalAlignment','Left',...
    'Parent',h.Handles.PNLDomain,'String','Custom','Units','Pixels', ...
    'Position',[15 17 113 15]);
LBLCenters = uicontrol('Style','Text','String','Vector of centers','HorizontalAlignment',...
    'Left','Parent',h.Handles.PNLDomain,'Units','Pixels','Position',[137 16 90 17]);
h.Handles.TXTCenters = uicontrol('Style','Edit','Parent',h.Handles.PNLDomain,'Units','Pixels', ...
    'Position',[233 12 168 21],'String','1:10','Callback', ...
    @(es,ed) updatebins(h),'HorizontalAlignment','Left','BackgroundColor',[1 1 1]);
