Starting in R2014b, graphics objects do not extend beyond the axes boundaries. Objects are clipped to the six sides of the axes box defined by the axes limits. For example, MATLAB® does not display the peaks of this surface that extend beyond the specified z-limits.
In R2014a and earlier, MATLAB uses a different technique to clip objects. Instead of clipping to the axes limits, MATLAB clips to the smallest 2-D rectangle that encloses the axes. For example, in previous releases, the same surface plot extends beyond the specified z-limits. The red rectangle indicates the boundaries used for clipping.
The axes and individual objects in the axes have a 'Clipping' property that controls the clipping behavior. By default, this property is set to 'on'. To disable clipping, set the 'Clipping' property to 'off'.
If the 'Clipping' property for the axes is 'on', then each individual object in the axes controls its own clipping behavior. To disable clipping for all objects in the axes, set the 'Clipping' property for the axes to 'off'.
For example, disable the clipping for all objects in the axes by setting the Clipping property of the axes to 'off'.
ax = gca;
ax.Clipping = 'off';
The new 'ClippingStyle' axes property introduced in R2014b controls the technique used to clip objects. Set this property to one of these values:
· '3dbox' — Clip objects to the six sides of the axes box defined by the axes limits. This is the default value.
· 'rectangle' — Clip objects to the smallest 2-D rectangle that encloses the axes in any given view.
To get the same style of clipping used in R2014a and earlier, set the ClippingStyle to 'rectangle'.
ax = gca;
ax.ClippingStyle = 'rectangle';