MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Custom ContourLabels in Contour Plots

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107732] Custom ContourLabels in Contour Plots
  • From: "David Park" <djmpark at comcast.net>
  • Date: Thu, 25 Feb 2010 01:51:01 -0500 (EST)

I would like to specify custom contour labels in Tooltips for contour plot.

 

ContourLabels has a form {f, g} where f gives an explicit displayed label,
and g gives a Tooltip for each complete contour. But I can't make this form
work and the Help has no explicit example of this form.

 

Here is an example of what I would like to do:

 

ContourPlot[Sin[x y] == 1/2, {x, 0, \[Pi]}, {y, 0, \[Pi]},

 ContourLabels ->

  {Function[{x, y, z}, Text["", {x, y}]],

   Function[{x, y, z}, Text["My Label"]]}

 ]  

 

No tooltips on the contours. I've tried a number of variations but nothing
works. Neither does it work on a regular ContourPlot.

 

ContourPlot[Sin[x y], {x, 0, \[Pi]}, {y, 0, \[Pi]},

 Contours -> 5,

 ContourLabels ->

  {Function[{x, y, z}, Text["", {x, y}]],

   Function[{x, y, z}, Tooltip["My Label"]]}

 ]  

 

Does anyone know how to do this?

 

 

David Park

djmpark at comcast.net

 <http://home.comcast.net/~djmpark> http://home.comcast.net/~djmpark/  

 




  • Prev by Date: Re: detection of automatic range of plot?
  • Next by Date: Re: Transition to Wolfram Workbench
  • Previous by thread: Re: Controlling Memory Usage from JLink
  • Next by thread: Re: Must tell Compile that Clip returns a number.