changeset 20188:f6c901a691d5

pcolor.m: Stop error message from some non-meshgrid plots (bug #44615). * pcolor.m: Check that xlimits and ylimits are monotically increasing before calling xlim() or ylim().
author Rik <rik@octave.org>
date Mon, 23 Mar 2015 20:43:08 -0700
parents 83dc1ab95429
children ed53c87050e8
files scripts/plot/draw/pcolor.m
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/pcolor.m
+++ b/scripts/plot/draw/pcolor.m
@@ -111,10 +111,18 @@
         endif
       endif
       if (all (xrng == fix (xrng)))
-        xlim ([min(xrng), max(xrng)]);
+        xmin = min (xrng);
+        xmax = max (xrng);
+        if (xmin < xmax)
+          xlim ([xmin, xmax]);
+        endif
       endif
       if (all (yrng == fix (yrng)))
-        ylim ([min(yrng), max(yrng)]);
+        ymin = min (yrng);
+        ymax = max (yrng);
+        if (ymin < ymax)
+          ylim ([ymin, ymax]);
+        endif
       endif
     endif