Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Re: Mouse-Over or Mouse-Click Values of Coordinates

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103695] Re: [mg103642] Re: Mouse-Over or Mouse-Click Values of Coordinates
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Fri, 2 Oct 2009 08:31:40 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

Manipulate[
 b = Round[a, .001];
 pt = {b, Round[Sin[b], .001]};
 Plot[Sin[x], {x, -Pi, Pi},
  Epilog -> {Red,
    PointSize[Medium],
    Point[pt], Black,
    Text[pt, pt,
     1.25 Sign[a] {1, 1}]}],
 {a, -Pi, Pi, Pi/100,
  Appearance -> "Labeled"}]


Bob Hanlon

---- Nasser Abbasi <nma at 12000.org> wrote: 

=============

"Gregory Lypny" <gregory.lypny at videotron.ca> wrote in message 
news:h9srm3$p3g$1 at smc.vnet.net...
> Hello everyone,
>
> Is there a way to include in Manipulate something like a tooltip,
> where the coordinates of a point in a plot appear where the user clicks.
>
> Regards,
>
> Gregory
>

I know how to do it with discrete data. Here is an example

data = Table[Tooltip[Sin[x]], {x, -Pi, Pi, Pi/100.}];
ListPlot[data, Joined -> True]

And now if you move the mouse over the plot, the y-value (i.e. sin(x) ) 
value will be displayed, here is a screen shot
http://12000.org/tmp/093009/tooltip.PNG

But with the direct plot command, I still can't figure it

Plot[Tooltip[Sin[x]], {x, -Pi, Pi}]

will display "Sin[x]", instead of the current value of it. As shown here:
http://12000.org/tmp/093009/tooltip2.PNG

I tried using Dynamics and Annotation with Mousover to get it to work, but 
no luck. I am sure some Mathematica expert here will have an answer on how 
to do it with a direct plot command instead of discrete plot.

--Nasser




__________ Information from ESET NOD32 Antivirus, version of virus signature database 4470 (20090930) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




  • Prev by Date: Re: Re: Incorrect symbolic improper integral
  • Next by Date: Re: Mouse-Over or Mouse-Click Values of Coordinates in Plot in Manipulate
  • Previous by thread: Re: Making raw HTML appear in a notebook exported to HTML
  • Next by thread: Re: White Noise in Simulation