comparison scripts/plot/draw/pcolor.m @ 17603: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 7bb76a22cde1
children 4975ccb0a916
comparison
equal deleted inserted replaced
17602:c0ce72efe5a8 17603:dcbab6f3e727
83 htmp = surface (x, y, z, c); 83 htmp = surface (x, y, z, c);
84 84
85 set (htmp, "facecolor", "flat"); 85 set (htmp, "facecolor", "flat");
86 if (! ishold ()) 86 if (! ishold ())
87 set (hax, "view", [0, 90], "box", "on"); 87 set (hax, "view", [0, 90], "box", "on");
88 ## FIXME: Maybe this should be in the general axis limit setting routine?
89 ## When values are integers, want to use tight limits.
90 if (all (x(:) == fix (x(:))))
91 xlim ([min(x(:)), max(x(:))]);
92 endif
93 if (all (y(:) == fix (y(:))))
94 ylim ([min(y(:)), max(y(:))]);
95 endif
88 endif 96 endif
89 97
90 unwind_protect_cleanup 98 unwind_protect_cleanup
91 if (! isempty (oldfig)) 99 if (! isempty (oldfig))
92 set (0, "currentfigure", oldfig); 100 set (0, "currentfigure", oldfig);