changeset 29904:4f51ea7a510a

Suppress incorrect warning in semilog[xy]err plots (bug #60959). * __errplot__.m (__do_errplot__): When creating the line objects that form the plot use initial "xdata", "ydata" of [1,1]. The default data for the plot system is [0, 1], [0, 1] and the point (0,0) causes an warning about non-positive data on log-axis plots.
author Rik <rik@octave.org>
date Thu, 22 Jul 2021 06:53:17 -0700
parents ef865fcd4611
children ad023dbe9606
files scripts/plot/draw/private/__errplot__.m
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/private/__errplot__.m	Wed Jul 21 13:25:46 2021 -0400
+++ b/scripts/plot/draw/private/__errplot__.m	Thu Jul 22 06:53:17 2021 -0700
@@ -126,8 +126,12 @@
     args = __add_datasource__ ("__do_errplot__", hg,
                                {"x", "y", "l", "u", "xl", "xu"});
 
-    hl = [(__line__ (hg, "color", lc, "linestyle", "-", "marker", "none")),
-          (__line__ (hg, "color", lc, "linestyle", ls, "marker", mk))];
+    ## Use a single data point for line rather than default data of [0, 1].
+    ## The real data will be applied to the line object later.  See bug #60959.
+    hl = [__line__(hg, "xdata", 1, "ydata", 1,
+                       "color", lc, "linestyle", "-", "marker", "none"),
+          __line__(hg, "xdata", 1, "ydata", 1,
+                       "color", lc, "linestyle", ls, "marker", mk)];
 
     switch (numel (varargin))
       case 2