Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Dynamic PlotLabel in Math6?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76224] Re: Dynamic PlotLabel in Math6?
  • From: Albert <awnl at arcor.net>
  • Date: Fri, 18 May 2007 06:07:11 -0400 (EDT)
  • References: <f2el71$25e$1@smc.vnet.net>

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):

FullGraphics[Plot[{
    Annotation[Sin[x], "Sine", "Mouse"],
    Annotation[Cos[x], "Cosine", "Mouse"]
    },
   {x, 0, 2 \[Pi]},
   PlotStyle -> Thick,
   PlotLabel :> Dynamic[MouseAnnotation[]]
   ]]

or:

Grid[{{
    Style[
     Dynamic[MouseAnnotation[] /. Null -> "Empty Space"],
     FontFamily -> "Helvetica"
     ]}, {Plot[{
      Annotation[Sin[x], "Sine", "Mouse"],
      Annotation[Cos[x], "Cosine", "Mouse"]
      },
     {x, 0, 2 \[Pi]},
     PlotStyle -> Thick
     ]
    }},
  ItemSize -> {Automatic, {2, All}}
  ]


hth,

albert


  • Prev by Date: Re: Mathematica 6.0 and MatrixManipulations
  • Next by Date: Re: v. 6, third argument to rectangle
  • Previous by thread: Re: Dynamic PlotLabel in Math6?
  • Next by thread: Re: Re: Dynamic PlotLabel in Math6?