How does the contour plot with R2014b work?
1 view (last 30 days)
I have a script which worked perfectly in the version R2014a and now I have some issues. First, my legend displays the wrong colours for the contour plot and secondly, I cannot change the clabel properties. This is a simplified Code without the Clabel properties:
>> hold on
The plot itself is correct, but the legend displays both times Purple, Green and Yellow (See image at the buttom). How do I have to change the Code to get also a red and a blue indication in the legend??
To the second problem: I understand, that clabel works different now. I have the following code:
clabel( C_LWC,h_LWC ,'LabelSpacing',250);
clabel( C_LWC ,'color','w',...
'BackgroundColor',[0.2157 0 0.3207],...
'FontName', strFontName, ...
'FontUnit', strFontUnit, ...
'FontSize', iFontSize*0.8, ...
'FontWeight', strFontWeight, ...
I would like to have the format of the second part (so the box, the color, the style), but on the position and also following the graph like in the first part (LabelSpacing). How do I do that now, that I have to use C_LWC,h_LWC for LabelSpacing and only C_LWC for the formating?
Thanks a lot!
Rob Comer on 5 Jun 2015
You can avoid the problem with the clabel function, which is present in both R2014b and R2015a, by using one of the workarounds available here: http://www.mathworks.com/support/bugreports/1114747. After downloading and installing the appropriate workaround, you will be able to control the appearance of contour label text with commands such as this:
[C,h] = contour(peaks);
The workaround will enable you to specify 12 properties that affect the appearance of contour labels. This includes all the properties shown in your code above, except for FontUnits. (Instead of setting FontUnits, you'll need to set the value of FontSize in units of 'points'.)