kbox.m
Creates a tickless boxed frame around the current axes using ordinary line objects that live in the same data space as the plot. This is needed for spectrograms because Matlab has dumb plotting defaults.
Any previous Spinach box overlay recorded in the SpinachKBox application data of the axes is removed first, together with its property listeners and its line object, and orphaned overlay axes tagged SpinachKBox are deleted from the parent figure. The built-in axes box is then switched off, the axes layer is set to top, and a single NaN-separated line strip is created in the axes itself, taking its colour from the axes XColor and its width from the axes LineWidth, with clipping off, hit testing off and handle visibility off. The XLimInclude, YLimInclude and ZLimInclude properties of that line are switched off, so the frame does not participate in autoscaling.
The frame is kept current by PostSet listeners on XLim, YLim, ZLim, LineWidth, XColor and Children, and by a MarkedClean listener; a busy flag and a stored signature of those properties suppress recursion and redundant redraws, so camera motion alone does not trigger an update. The updater treats the axes as three-dimensional when the view elevation differs from 90 degrees or when any child object carries non-empty ZData, in which case the twelve edges of the limit box are drawn; otherwise the four edges of the limit rectangle are drawn in the z=0 plane. The line object is finally moved to the front of the child list, so that the frame is drawn above the grid and the data.
Syntax
kbox()
Parameters
none
Outputs
creates or updates a tickless axis box
in the current axes
See also
kgrid.m, kfigure.m, kxtickfix.m, kytickfix.m, kztickfix.m, scale_figure.m, Appendix_H:_Matlab_object_overloads
Version 2.13, authors: Ilya Kuprov