MATLAB: With what command i can change the width of contours created with SURFC from the beginning

contoursurfcwidth

Hi friends
I created a 3D figure using SURFC. Now I want to increase the width of contours appeared in figure to 2, but I can not select contours to change their width. How can I plot the figure with wider contours from the beginning (what property or command)?
thank you

Best Answer

The property is LineWidth, but things are a little tricky with surfc. The surfc command turns around and calls surf and contour. It is going to pass all of the property/value pairs you give it to the surf command, not the contour command. That means that if we do this:
surfc(peaks,'LineWidth',4)
We'll get wide lines on our surface, rather than on our contour.
The easiest way to set properties on the contour object is to get the return value from surfc.
h = surfc(peaks)
This should say something like this:
h =
2x1 graphics array:
Surface
Contour
That's saying that h is an array of two graphics objects. The first is the surface and the second is the contour. That means that we can do things like this:
h(2).LineWidth = 4
Related Question