changeset 28355:3da71c0527a1

legend.m: don't return handle when nargout == 0 and gnuplot used (bug #58430). * legend.m: Test for nargout == 0 before deciding how to invoke __gnuplot_legend__.
author Rik <rik@octave.org>
date Sat, 23 May 2020 08:22:19 -0700
parents b55dd2734aeb
children 4e4baa5ac03c
files scripts/plot/appearance/legend.m
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/appearance/legend.m	Sat May 23 08:05:20 2020 -0700
+++ b/scripts/plot/appearance/legend.m	Sat May 23 08:22:19 2020 -0700
@@ -127,7 +127,11 @@
 
   ## Use the old legend code to handle gnuplot toolkit
   if (strcmp (graphics_toolkit (), "gnuplot"))
-    [hleg, hleg_obj, hplot, labels] = __gnuplot_legend__ (varargin{:});
+    if (nargout > 0)
+      [hleg, hleg_obj, hplot, labels] = __gnuplot_legend__ (varargin{:});
+    else
+      __gnuplot_legend__ (varargin{:});
+    endif
     return;
   endif