function [lm] = lebesgue_2D(F, ub)
% Efficient method for 2D objective function values
L = sortrows(F',1)';
l = length(L(1,:));
orig=ub(2);
lm = 0;
for i = 1:l
lm = lm + (min((L(1,i) - ub(1)),0) * min((L(2,i) - ub(2)),0));
if L(2,i)<=orig
ub(2) = L(2,i);
end
end
end

Please let me know if there is something fundamentally wrong with my change.

I was using your Lebesgue measure for comparing a few algorithm, but when very few (less than 10) points fall below the reference point, the algorithm produces a negative value. Originally I thought the negative values might happen when no points fall below the reference points and that I could simply replace the negative values with zeroes, but that does not seem to be the case.