How to label the levels of a fcontour plot?
22 views (last 30 days)
Star Strider on 14 Apr 2017
You must use the contour function to get the contour labels.
Combining fcontour and contour to get the result you want (in figure(2) here) is not difficult. You first need to get the data fcontour creates. You can do that by returning the handle to it, and then accessing its properties.
Using an example from the documentation for fcontour and adapting it to use contour:
f(x,y) = sin(x) + cos(y);
hfc = fcontour(f);
contour(hfc.XData, hfc.YData, hfc.ZData, 'ShowText','on')
Although this takes one more line of code, it will give you the result you want.