I have issues getting the spy
library to work on my current installation. I am running TeXmaker with MikTeX 2.9 (with all packages updated) on Win8.1x64.
I read about the issues others are having with this here and here, but I still don't get it to work using PdfLaTeX with direct pdf output.
This is the MWE I am using:
\documentclass{minimal}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{arrows,calc,spy}
\begin{document}
\begin{tikzpicture}
% Using Wikipedia's image of the day
\node[anchor=south west,inner sep=0] (image) at (0,0){\includegraphics[width=0.65\textwidth]{Coiled_Galaxy.jpg}};
\begin{scope}[x={(image.south east)},y={(image.north west)},
spy using outlines={red,circle,magnification=4, size=3cm,connect spies}]
% \foreach \x in {0,1,...,9} { \node [anchor=north] at (\x/10,0) {0.\x}; }
% \foreach \y in {0,1,...,9} { \node [anchor=east] at (0,\y/10) {0.\y}; }
\spy on (0.70,0.95) in node at (0.5,1.2);
\end{scope}
\end{tikzpicture}
\\
Pgf Version: \pgfversion
\end{document}
% Log
% This is pdfTeX, Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9) (preloaded format=pdflatex 2015.7.29)
And this is my result:
EDIT: My mistake was as Ulrike Fischer pointed out, there was no image for spy to work with, nothing to do with my packages.
The fixed solution is:
\documentclass{minimal}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{arrows,calc,spy}
\begin{document}
\begin{tikzpicture}[ spy using outlines={red,circle,magnification=4, size=3cm,connect spies}]
% Use Wikipedias image of the day
\node[anchor=south west,inner sep=0] (image) at (0,0){\includegraphics[width=0.65\textwidth]{Coiled_Galaxy.jpg}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
\foreach \x in {0,1,...,9} { \node [anchor=north] at (\x/10,0) {0.\x}; }
\foreach \y in {0,1,...,9} { \node [anchor=east] at (0,\y/10) {0.\y}; }
\end{scope}
\spy on ($0.95*(image.south east)+0.95*(image.north west)$) in node at ([yshift=1cm]image.north);
\end{tikzpicture}
\\
Pgf Version: \pgfversion
\end{document}
\spy on ($0.5*(image.south)+0.5*(image.center)$) in node at ([yshift=1cm]image.north);