
automating labels on contours?
To get ready for a new semester I would like to make it easier to plot contours and lines involved in constrained optimization problems, like the one in this picture. (The "find the max or min of f(x,y) subject to the constraint g(x,y) = const" sorts of problems.)
I did this manually, generating the contours "f(x,y)=c" using a parameter, but then creating and placing the labels of "c" manually, one by one. Ick. This is terribly inefficient. Has anyone cracked the case of plotting a set of curves "f(x,y) = c" and then also coding in the labeling of the curves with the associated values of "c" in a good place? And would you be willing to share? Here's a link to my primitive caveman set up of this image as-is.