From ff6498ca0d0fdba187034bb27d2371973c79e0bf Mon Sep 17 00:00:00 2001 From: Egon Geerardyn Date: Wed, 13 Feb 2019 19:53:52 +0100 Subject: [PATCH] Revert "Fix for GNU/Octave not including legends" --- src/matlab2tikz.m | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/matlab2tikz.m b/src/matlab2tikz.m index 98d8c1339..635da1969 100644 --- a/src/matlab2tikz.m +++ b/src/matlab2tikz.m @@ -1048,21 +1048,14 @@ case guitypes() % Get legend handle associated with current axis legendhandle = []; - [env, envVersion] = getEnvironment(); + env = getEnvironment(); switch env case 'Octave' % Make sure that m2t.legendHandles is a row vector. for lhandle = m2t.legendHandles(:)' - if isVersionBelow(envVersion, [4,2,2]) % Octave commit 5865d2fef424 - lhandleProp{1}='UserData'; - lhandleProp{2}='handle'; - else - lhandleProp{1}='__appdata__'; - lhandleProp{2}='__axes_handle__'; - end - ud = get(lhandle, lhandleProp{1}); + ud = get(lhandle, 'UserData'); % Empty if no legend and multiple handles if plotyy - if ~isempty(ud) && any(axisHandle == ud.(lhandleProp{2})) + if ~isempty(ud) && any(axisHandle == ud.handle) legendhandle = lhandle; break end