11

The pgf manual isn't really explicit about it, so i'm here to ask it to the stack communauty. I tried to put some shadow/blur effect around the spyonnode but with no effect at all !

I tried this :

\begin{tikzpicture}[spy using overlays={
            circle,
            magnification=2,
            size=1.5cm,
            connect spies,
            Ggray1
     }
]
...
\spy[circular drop shadow,
     spy connection path={
     \draw[thick] (tikzspyonnode) -- (tikzspyinnode);
     }
] on (spypoint) in node at (3.25,-1.35);
\end{tikzpicture}

Do someone have an idea?

percusse
  • 157,807
Rave
  • 907
  • 1
  • 7
  • 14

1 Answers1

17

You can define your own spy style with the example given in Section 49.5 of PGF/TikZ manual. Here is one such modification with shadowed spy windows.

\documentclass{standalone}
\usepackage{pgfplots}
\usetikzlibrary{spy,shadows}
\tikzset{spy using overlaysshadow/.style={
    spy scope={#1,
         every spy on node/.style={
            circle,
            fill, fill opacity=0.2, text opacity=1
             },
         every spy in node/.style={
                 circle, circular drop shadow,
                 fill=white, draw, ultra thick, cap=round
            }
        }
    }
}
\begin{document}
\begin{tikzpicture}[spy using overlaysshadow={
           magnification=3, 
    size=1.5cm, 
    connect spies}
]
\begin{axis}
\addplot3[surf,shader=faceted,
samples=25,domain=0:2,y domain=0:1]
{exp(-x) * sin(pi*deg(y))};
\begin{scope}
\spy [red] on (2,3cm) in node at (3.5cm,-1.25cm);
\spy [blue,size=1cm] on (3cm,1cm) in node  at (0,-1.25cm);
\end{scope}
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

percusse
  • 157,807
  • Thanks for a so quick answer but it doesn't seem working with my style based on the code in the question: – Rave May 20 '12 at 17:26
  • @Rave Can you give a small but compilable example that show the problem so that we can look at it together? I can't guess the problem as it is. – percusse May 20 '12 at 17:30
  • Yes sorry i tried to edit my answer put some picture in it but i wasn't quick enough: Pic_shadow. The "spy in node" is really to dark compared to the "spy on node" – Rave May 20 '12 at 17:34
  • @Rave The grayness you see is the shadow itself because the node is not filled. Add fill=white or any other color to fill it. Have a look at the in node style in my answer. – percusse May 20 '12 at 17:39
  • Already tried but it went copmletly white and with my color it is to dark : compare white and my color I'm gonna try a fill=mycolor!%!white to see what's gonna happen – Rave May 20 '12 at 17:49
  • Before shadowing my spy in node and spy on node had the same intensity of gray. And i have it back with a fill=mycolor!20!white Anyway thanks a lot for your help it fits perfect now – Rave May 20 '12 at 17:56
  • @Rave My pleasure – percusse May 20 '12 at 19:40