MathGroup Archive 2009

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

Search the Archive

Re: tooltip - evaluate function at point

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98770] Re: tooltip - evaluate function at point
  • From: dbreiss at gmail.com
  • Date: Sat, 18 Apr 2009 03:39:47 -0400 (EDT)
  • References: <gs6pjo$h7i$1@smc.vnet.net> <gs9ejj$ms2$1@smc.vnet.net>

Hi Cristina,

The problem here seems to be that ContourPlot has built into it a
tooltip that tells you which equation the contour lines correspond
to.  This actually was what I thought was a bug in my example, but I
realize that it is a "feature" of ContourPlot.  I have to think of how
to turn that off, as that tooltip seems to preempt any other tooltip
that is imposed on the plot as I did.

....Ah, this seems to do the trick, I think, using the option
ContourLabels -> None]:

With[{plot =
   ContourPlot[Arg[Gamma[x + I*y]] == 0, {x, -10, 10}, {y, -10, 10},
    PlotPoints -> 20, ContourLabels -> None]},
 Dynamic@Tooltip[
   plot, (With[{z = Complex @@ MousePosition["Graphics"]}, {z, Gamma
[z]}])]]

Yes, if you look up the ContourLabels documentation, this is indeed
what's needed.

Does this work for you?

Best regards,

David

_______________________________________________________
On Thu, Apr 16, 2009 at 9:50 PM, Cristina <> wrote:
David,

Thank you for your help. Unfortunately, this shows the value of Gamma
at all points other than the points on the solution curves given by Arg
[Gamma[x+I*y]]==0. When the mouse goes over the points on the curve
the tooltip gives only "Arg[Gamma[x+I*y]]==0. But I am interested in
the value of Gamma precisely at the points on the curves above.

Best wishes,

Cristina

>>> <David> 04/16/09 8:09 PM >>>
Here is the start of one sort of approach.  It seems ot have some
bugginess though.  But perhaps this will get you going:

With[{plot =
  ContourPlot[Arg[Gamma[x + I*y]] == 0, {x, -10, 10}, {y, -10, 10},
   PlotPoints -> 20]},
 Dynamic@Tooltip[
  plot,
  (With[{z = Complex @@ MousePosition["Graphics"]},
    {z, Gamma[z]}])
  ]
 ]



I suspect that someone else will give you a more stable approach....

--David



On Apr 16, 4:18 am, "Cristina" <>
wrote:
> I would like to plot the solutions to an equation using ContourPlot and
> add a tooltip that evaluates a different function at the points on the
> solution. In particular, for the plot
>
> ContourPlot[Arg[Gamma[x + I*y]] == 0, {x, -10, 10}, {y, -10, 10}, PlotPoints -> 20]
>
> when the cursor is over a solution point I would like the ToolTip to
> display the value of Gamma at that point. Is this possible? If so, any
> suggestion is greatly appreciated.
>
> Cristina





--
This message and any attachments, may contain confidential and/or
legally privileged information.  If you are not the intended
recipient of the message by the original sender, please destroy it.
Message and attachments copyright (c) 2009, all rights reserved.  Any
unauthorized dissemination, distribution or copying is strictly
forbidden.


  • Prev by Date: Re: Re: Imaginary numbers - most interesting points
  • Next by Date: Re: Any way to make help browser remember the last
  • Previous by thread: Re: tooltip - evaluate function at point
  • Next by thread: Re: tooltip - evaluate function at point