MATLAB: Are patch objects created even when I specify the ‘LineSpec’ argument to the CONTOUR function in MATLAB 7.0 (R14)

childcontourcontour3countourgrouphggrouplinelinespeclinestyleMATLABobjectpatchstylev6

In MATLAB 7.0 (R14), I enter the following commands:
z=peaks;
[c, h] = contour (z,'linestyle','-');
kids = get(h,'Children')
get(kids,'Type')
The CONTOUR function creates patch objects parented by the contourgroup object. I expect line objects as stated in the documentation:
...contour(...,LineSpec) draws the contours using the line type and color specified by LineSpec. contour ignores marker symbols.

Best Answer

This enhancement has been incorporated in Release 2006a (R2006a). For previous product releases, read below for any possible workarounds:
There is an error in the documentation for the CONTOUR function in MATLAB 7.0 (R14). The CONTOUR function always creates patch graphics objects, even if the 'LineSpec' argument is specified in the function call. To work around the issue, use the 'v6' option with the 'LineSpec' argument to create line objects using CONTOUR. Here are the steps:
Z=peaks;
[C,h] = contour('v6',Z,'-');