changeset 17658:dcbab6f3e727

pcolor.m: Use tight axis limits when x-values, y-values are integers. * scripts/plot/draw/pcolor.m: Test x,y values for being integers (such as from meshgrid) and set tight limits if found.
author Rik <rik@octave.org>
date Tue, 08 Oct 2013 08:50:06 -0700
parents c0ce72efe5a8
children 4975ccb0a916
files scripts/plot/draw/pcolor.m
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/pcolor.m
+++ b/scripts/plot/draw/pcolor.m
@@ -85,6 +85,14 @@
     set (htmp, "facecolor", "flat");
     if (! ishold ())
       set (hax, "view", [0, 90], "box", "on");
+      ## FIXME: Maybe this should be in the general axis limit setting routine?
+      ##        When values are integers, want to use tight limits.
+      if (all (x(:) == fix (x(:)))) 
+        xlim ([min(x(:)), max(x(:))]);
+      endif
+      if (all (y(:) == fix (y(:)))) 
+        ylim ([min(y(:)), max(y(:))]);
+      endif
     endif
 
   unwind_protect_cleanup