MathGroup Archive 2007

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

Search the Archive

Re: Re: Dynamic PlotLabel in Math6?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg77467] Re: [mg77224] Re: Dynamic PlotLabel in Math6?
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sat, 9 Jun 2007 05:38:43 -0400 (EDT)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <f2el71$25e$1@smc.vnet.net> <200706061042.GAA23169@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

Perhaps it's clearer to use Tooltip, so that the label appears directly 
near the cursor position as the cursor approaches the curve (and 
highlighted against a colored background):

   Plot[{Tooltip[Sin[x]],Tooltip[Cos[x]]},{x,0,2Pi},PlotStyle->Thick]


Pratik Desai wrote:
> On May 16, 5:08 am, "W. Craig Carter" <ccar... at mit.edu> 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
> 
> Hello Craig,
> 
> I think one possible way to do this is just to tweak your code a
> little bit by moving the Dynamic out.
> 
> Dynamic@Plot[{Annotation[Sin[x], "Sine", "Mouse"],
>    Annotation[Cos[x], "Cosine", "Mouse"]}, {x, 0, 2 \[Pi]},
>   PlotStyle -> Thick, PlotLabel -> MouseAnnotation[]]
> 
> And this works.
> 
> Hope this helps
> 
> Sincerely,
> Pratik Desai
> 
> 
> 
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Selecting Sub-lists After Split
  • Next by Date: Re: 6.0 Standard Packages?, New Style Documentation?
  • Previous by thread: Re: Dynamic PlotLabel in Math6?
  • Next by thread: Re: Segregating the elements of a list based on given lower and upper