From ad5d83d1ebc3c494728ac19d5f2958fe0e2db1d3 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Mon, 9 Oct 2023 13:22:09 +0200 Subject: [PATCH] Fix legend position layout --- src/matlab2tikz.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/matlab2tikz.m b/src/matlab2tikz.m index 9c25805f..31b4d991 100755 --- a/src/matlab2tikz.m +++ b/src/matlab2tikz.m @@ -5470,10 +5470,10 @@ function warnFacetedInterp(m2t) case 'southwestoutside' position = [-dist, 0]; anchor = 'south east'; - case 'none' + case {'none', 'layout'} legendPos = get(handle, 'Position'); unit = get(handle, 'Units'); - if isequal(unit, 'normalized') + if isequal(unit, 'normalized') && ~isequal(lower(loc), 'layout') position = legendPos(1:2); else % Calculate where the legend is located w.r.t. the axes.