This is expected behavior because the axes object does not save an associated legend. You will need to make a separate call to "copyobj" on a legend to copy a legend to your new figure. The following code snippet illustrates this (toggle the "copyLegend" variable to determine whether the legend is copied):
close all;
copyLegend = true;
plot(1:10);
hleg = legend('myplot');
hax1 = gca;
ftmp = figure;
new_axes = copyobj(hax1,ftmp);
if copyLegend
copyobj(hleg,ftmp);
end
A legend will only appear on Figure 2 if "copyLegend" is set to true.