Re: MousePosition with PlotLegends
- To: mathgroup at smc.vnet.net
- Subject: [mg116162] Re: MousePosition with PlotLegends
- From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
- Date: Thu, 3 Feb 2011 05:34:37 -0500 (EST)
- References: <ii8sa9$2p1$1@smc.vnet.net>
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 telefonica.net> 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[= {Red, > Disk[{0,0},1]}],Sin[x]<0}}] ]; > > In[3]:= (* This gives the full PlotRange definition for the resultin= g > 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= g > 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= d,D > 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 = the > mouse over the graphics does not coincide with the coordinates correspond= ing > to the range limits given by the PlotRange setting got above*) > > No attempt with the MousePosition different options has helped me to solv= e > the issue, and I never had this kind of problem until I used MousePositio= n > and PlotLegends togheter. > > Any help will be welcome > > E. Martin-Serrano > > ___________________________________________________ > > This e-mail and the documents attached are confidential and intended sole= ly > 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 integr= ity > cannot be secured on the Internet, E. Mart=EDn-Serrano liability cannot= be > triggered for the message content. Although the sender endeavors to maint= ain > 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= lting > 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= ste > 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= mitente, > 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 r= esultar de > una transmisi=F3n de virus.