legendflex-pkg icon indicating copy to clipboard operation
legendflex-pkg copied to clipboard

Fix for input of an element of an array of axis handles

Open SchapplM opened this issue 1 year ago • 0 comments

If I give the ref input of legendflex as an element of an axis handle array, the previous implementation leads to an error. The array can be constructed by

axhdl = NaN(4,3);
for i = 1:11 % last element (bottom right) remains NaN
  axhdl(i) = subplot(4,3,i);
  % do plotting ...
end
lfhdl = legendflex(legdummyhdl, leglbl, 'anchor', {'se','sw'}, ...
  'ref', axhdl(4,2));

Maybe this only arises when the array is not completely filled with handles and some NaN remain. This PR fixes the problem for me (Matlab R2022b).

SchapplM avatar May 28 '23 15:05 SchapplM