MathGroup Archive 2007

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

Search the Archive

Re: Re: Dynamic PlotLabel in Math6?

  • To: mathgroup at
  • Subject: [mg76297] Re: [mg76224] Re: Dynamic PlotLabel in Math6?
  • From: "Lev Bishop" <lev.bishop+mathgroup at>
  • Date: Sat, 19 May 2007 04:38:23 -0400 (EDT)
  • References: <f2el71$25e$> <>

On 5/18/07, Albert wrote:
> W. Craig Carter wrote:
> > It would be convenient if this construction would work in
> > math6:
> > Plot[{Annotation[Sin[x], "Sine", "Mouse"], Annotation[Cos[x], "Cosine", "Mouse"]}, {x, 0, 2 \[Pi]},
> >   PlotStyle -> Thick, PlotLabel -> Dynamic[MouseAnnotation[]]]
> > (i.e., use the label as a dynamic legend)
> >
> > This kind of works, if you know a priori to click and
> > pull up the pop-up window:
> > PopupWindow[
> >   Plot[{Annotation[Sin[x], "Sine", "Mouse"],
> >     Annotation[Cos[x], "Cosine", "Mouse"]}, {x, 0, 2 \[Pi]},
> >    PlotStyle -> Thick], Dynamic[MouseAnnotation[]]]
> >
> > Any ideas on how to make the first construction work
> > dynamically?
> >
> > Craig
> Looks like changing the PlotLabel directly is not possible, presumably
> because the information is just in the options of the Graphics. But
> there are workarounds (for me for some reason the AspectRatio changes
> with the first version):

No, with the above code you are actually changing the plotlabel so
many times per second that it looks like it isn't changing (but open
task monitor and look at the cpu load!).

The problem seems to be that changing the plotlabel for an object
means that the mouseover state needs to be refreshed for that object,
which means that the plotlabel needs to be refreshed, which means...
an so on in a tight loop so long as the mouse is in the graphics
object. Either of the following will work though:



The second is more efficient/smooth because it doesn't involve the kernel.

You could also use Tooltip[] or StatusArea[] instead of Annotation[]
for a different effect, if you like those better (don't have to click
like with PopupWindow[])


  • Prev by Date: Re: Mathematica 6.0 and MatrixManipulations
  • Next by Date: Re: Close Evaluation Cell in Version 6.0
  • Previous by thread: Re: Dynamic PlotLabel in Math6?
  • Next by thread: Subject of Formular