MATLAB: How to modify the text of the contour labels on the contour plot in MATLAB 7.3 (R2006b)

MATLAB

I would like to convert my contour labels to scientific notation because the numbers are too large to display in standard format.

Best Answer

The ability to modify the text labels on a contour plot is not available in MATLAB.
To work around this issue, you will need to manually draw the text labels. You can do this from the Plot Tools GUI or by using the TEXT function.
For example, the following code spells out the label numbers on a filled contour plot:
[x,y] = meshgrid(-5:.1:5,-5:.1:5);
z = x.^2-y.^2;
[c,h] = contourf(x,y,z,-20:10:20);
text(-3.1,-3,'zero','BackgroundColor','white')
text(-3.4,0,'ten','BackgroundColor','white')
text(-4.75,0,'twenty','BackgroundColor','white');
Related Question