# HG changeset patch # User Rik # Date 1381247406 25200 # Node ID dcbab6f3e7270e48bfb47cfbbf914290c29c1df1 # Parent c0ce72efe5a806100b0fd915bead01c0b5e6650e 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. diff -r c0ce72efe5a8 -r dcbab6f3e727 scripts/plot/draw/pcolor.m --- a/scripts/plot/draw/pcolor.m Tue Oct 08 08:18:27 2013 -0700 +++ b/scripts/plot/draw/pcolor.m Tue Oct 08 08:50:06 2013 -0700 @@ -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