f1 = 'logicalapproach_P2L1_Food Deprivation.fig';
f2 = 'logicalapproach_P2L1_Pre-Feeding.fig';
leg = findobj(fig2,'Type','legend');
fig1axChildren = get(fig1ax,'Children');
fig2axChildren = get(fig2ax,'Children');
h1 = copyobj(fig1axChildren, ax);
h2 = copyobj(fig2axChildren, ax);
hasDisplayName = ~cellfun('isempty',get(h,'DisplayName'));
legend(ax, h(hasDisplayName),'Location', leg.Location)
title(ax,"Combined plot")
xlabel(ax, fig2ax.XLabel.String)
ylabel(ax, fig2ax.YLabel.String)
function recolorgroups(objs)
objColors = cell2mat(get(objs,'color'));
[~, groups, groupID] = unique(objColors,'rows');
hh = objs(groupID == groups(i));
set(hh,'ColorMode','auto');
set(hh(2:end),'SeriesIndex', hh(1).SeriesIndex)
set(hh,{'MarkerFaceColor'},get(hh,'color'));