This is an old question I know, but I just spend some time figuring out how to do this using Kelly's idea but without "legendflex".
The following code produces a data figure and a separate legend of outer dimension 4 x 2inches and centered inner dimensions of 3.5 x 1.5 inches.
Giving ax2 a width of 0 inches and a height of 0 inches, "erases" the figure 2 coordinate plane.
---------------------------------------------------------------------------
fig1 = figure;
hl = plot(1:10, rand(2,10));
fig2 = figure;
set(fig2,'Units','inches')
set(fig2,'Position',[5 5 4 2]);
%Note: Figure Position = [left bottom width height] where left and bottom] are measured from the lower left corner of the monitor.
ax2 = gca;
set(ax2,'Units','inches')
set(ax2,'Position',[0 0 0 0]);
%Note: Axes Position = [left bottom width height] where left and bottom] are measured from the lower left corner of the figure.
legend(ax2, hl, {'Thing 1', 'Thing 2'},'Position',[.25/4 .25/2 3.5/4 1.5/2])
%Note: Legend Position = [left/figurewidth bottom/figureheight width/figurewidth height/figureheight],i.e. Legend positions must be specified relative to the figure dimensions if you are not using "legendflex".