labelledcontourplot := proc (f, xr, yr) options `Maple Advisor Database 1.01 for Maple 6`, `Copyright (c) 2000 by Robert B. Israel. All rights reserved`; local pl, flag, x, y, c, d, pt, labs, v, opts, fnt, tcolour, t, ys; if type(f,list) then error "Can''t label parametric contour plot" end if; opts:= [args[4..-1]]; if (hasoption(opts,'textcolour','tcolour','opts') or hasoption(opts,'textcolor','tcolour','opts')) then tcolour:= colour=tcolour else tcolour:= NULL fi; if hasoption(opts,'font','fnt','opts') then fnt:= font = fnt else fnt:= NULL fi; if type(xr,range) then flag := true; pl:= plots[contourplot](f,xr,yr,op(opts)); else flag := false; x := op(1,xr); y := op(1,yr); if has(yr,x) then c:= op([2,1],yr); d:= op([2,2],yr); ys:= c+(d-c)*t; pl:= plots[contourplot]([x,ys,subs(y=ys,f)],xr, t=0..1,labels=[x,y],op(opts)); else pl := plots[contourplot]([x,y,f],xr,yr,op(opts)); fi; fi; labs := NULL; for c in indets(pl,specfunc(anything,CURVES)) do pt := op([-2, 2],c); if flag then v := f(pt[1],pt[2]) else v := eval(subs(x = pt[1],y = pt[2],f)) end if; v := 0.01*round(100*v); labs := labs, [op(pt), sprintf("%3.2f",v)] end do; plots[display]({pl, plots[textplot]({labs}, align = {ABOVE, RIGHT}, fnt, tcolour)}) end proc;