MATLAB: How to alter contour label properties

clabelcontourcontourf

How can I change contour label properties without getting the warning shown below?
[cc, hh] = contourf(peaks);
t = clabel(cc, hh); % This command generates the warning
t.FontWeight = 'bold'; % Does not produce bold font
Warning: Text handle output is not supported for managed labels.
No public field FontWeight exists for class matlab.graphics.GraphicsPlaceholder.
(Can't find any reference to "managed labels" in documentation or clabel code.)

Best Answer

If you download and install one of the workarounds available here for R2014b or R2015a: http://www.mathworks.com/support/bugreports/1114747, you'll be able to use commands like the following to control the FontWeight of your labels:
clabel(C,h,'FontWeight','bold')
The workaround will enable a total of 12 properties that affect the appearance of contour labels: Color, FontName, FontSize, FontWeight, and 8 others.