MathGroup Archive 2011

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

Search the Archive

Re: MousePosition with PlotLegends

  • To: mathgroup at
  • Subject: [mg116162] Re: MousePosition with PlotLegends
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at>
  • Date: Thu, 3 Feb 2011 05:34:37 -0500 (EST)
  • References: <ii8sa9$2p1$>

It works for me. The problem may lie in the way the plot range you
found ( {{-1., -0.15}, {-1.05, -0.4}}) I get is formatted.

It is not {{xmin,ymin},{xmax,ymax}}, a rectangle specification, but
{{xmin,xmax},{ymin,ymax}}. Also, the drop shadow belongs to the range.

Cheers -- Sjoerd

On Feb 1, 12:54 pm, "E. Martin-Serrano"
<eMartinSerr... at> wrote:
> Hi,
> The following is an example of the problem I am facing in using
> MousePosition[] over graphics containing legends, with Mathematica 7.01.
> (W-XP) SP3.
> In[1]:= Needs["PlotLegends`"]
> (* Graphics primitives making up a legend *)
> In[2]:=
> g=Graphics[Legend[{{Graphics[{Blue,Disk[{0,0},1]}],Sin[x]>0},{Graphics[=
> Disk[{0,0},1]}],Sin[x]<0}}] ];
> In[3]:= (* This gives the full PlotRange definition for  the resultin=
> graphics *)
> In[4]:= PlotRange/.FullOptions[g]
> Out[4]= {{-1.,-0.15},{-1.05,-0.4}}
> In[5]:= (*This gives the simplify PlotRange definition for the resultin=
> graphics *)
> In[6]:=
> Cases[AbsoluteOptions[g],HoldPattern[PlotRange->pr_]:>pr[[2]],1,1][[1]]
> Out[6]= {-1.05,-0.4}
> In[7]:= (* This renders the picture with the MousePosition["Graphics"]
> feature included *)
> In[8]:=
> {Graphics[Legend[{{Graphics[{Blue,Disk[{0,0},1]}],Sin[x]>0},{Graphics[{Re=
> isk[{0,0},1]}],Sin[x]<0}}] ], Dynamic@MousePosition["Graphics"]}
> Out[8]:=  (* the picture in Out[8]  has been deleted, you can get i=
t by
> executing  In[8]  *)
>  (* But the coordinates given by MousePosition["Graphics"] when moving =
> mouse over the graphics does not coincide with the coordinates correspond=
> to the range limits given by the PlotRange setting got above*)
> No attempt with the MousePosition different options has helped me to solv=
> the issue, and I never had this kind of problem until I used MousePositio=
> and PlotLegends togheter.
> Any help will be welcome
> E. Martin-Serrano
> ___________________________________________________
> This e-mail and the documents attached are confidential and intended sole=
> for the addressee; it may also be privileged. If you receive this e-mail =
> error, please notify the sender immediately and destroy it. As its integr=
> cannot be secured on the Internet, E. Mart=EDn-Serrano liability cannot=
> triggered for the message content. Although the sender endeavors to maint=
> a computer virus-free network,  the sender does not warrant that this
> transmission is virus-free and  will not be liable for any damages resu=
> from any virus transmitted.
> Este mensaje y los ficheros adjuntos pueden contener informaci=F3n
> confidencial  destinada solamente a la(s) persona(s) mencionadas
> anteriormente  pueden estar protegidos por secreto profesional y en
> cualquier caso el mensaje en su totalidad est=E1  amparado y protegid=
o por la
> legislaci=F3n vigente que preserva el secreto de las comunicaciones, y =
por la
> legislaci=F3n de protecci=F3n de datos de car=E1cter personal. Si u=
sted recibe
> este correo electr=F3nico por error, gracias por informar  inmediatam=
ente al
> remitente y destruir el mensaje. Al no estar asegurada la integridad de e=
> mensaje sobre la red, E. Mart=EDn-Serrano no se hace responsable por su
> contenido. Su contenido no constituye ning=FAn  compromiso para el re=
> salvo ratificaci=F3n escrita por ambas partes.  Aunque se esfuerza al=
> por mantener su red libre de virus, el emisor  no puede garantizar nada=
> respecto y no ser=E1 responsable de cualesquiera da=F1os que puedan r=
esultar de
> una transmisi=F3n de virus.

  • Prev by Date: Re: Protect a variable against being used as an iterator
  • Next by Date: Re: How to start new input line?
  • Previous by thread: MousePosition with PlotLegends
  • Next by thread: ascii quotes in Program cell