MousePosition with PlotLegends
- To: mathgroup at smc.vnet.net
- Subject: [mg116088] MousePosition with PlotLegends
- From: "E. Martin-Serrano" <eMartinSerrano at telefonica.net>
- Date: Tue, 1 Feb 2011 06:55:02 -0500 (EST)
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[{Red, Disk[{0,0},1]}],Sin[x]<0}}] ]; In[3]:= (* This gives the full PlotRange definition for the resulting 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 resulting 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[{Red,D isk[{0,0},1]}],Sin[x]<0}}] ], Dynamic@MousePosition["Graphics"]} Out[8]:= (* the picture in Out[8] has been deleted, you can get it by executing In[8] *) (* But the coordinates given by MousePosition["Graphics"] when moving the mouse over the graphics does not coincide with the coordinates corresponding to the range limits given by the PlotRange setting got above*) No attempt with the MousePosition different options has helped me to solve the issue, and I never had this kind of problem until I used MousePosition and PlotLegends togheter. Any help will be welcome E. Martin-Serrano ___________________________________________________ This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, E. Mart=EDn-Serrano liability cannot be triggered for the message content. Although the sender endeavors to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting 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 protegido 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 usted recibe este correo electr=F3nico por error, gracias por informar inmediatamente al remitente y destruir el mensaje. Al no estar asegurada la integridad de este mensaje sobre la red, E. Mart=EDn-Serrano no se hace responsable por su contenido. Su contenido no constituye ning=FAn compromiso para el remitente, salvo ratificaci=F3n escrita por ambas partes. Aunque se esfuerza al m=E1ximo por mantener su red libre de virus, el emisor no puede garantizar nada al respecto y no ser=E1 responsable de cualesquiera da=F1os que puedan resultar de una transmisi=F3n de virus.