2

I tried to use the TikZlibrary spy to zoom in on a certain pixel image; I am drawing in the image using a scope and red about the problem concerning coordinates in scopes here Magnify part of picture with TikZ spy, expressed in relative scoped coordinates

My problem is, that spy seems to place the point in the image correctly but then chooses the wrong part to magnify, for example in the MWE

\documentclass[german,10pt,xcolor=colortbl,compress]{beamer}
\usepackage{xunicode}
\usepackage{calc}
\usepackage{graphicx,tikz}
\usetikzlibrary{spy,calc}
\RequirePackage[no-math]{fontspec} 
\RequirePackage{xltxtra}
\setbeamertemplate{navigation symbols}{}
\begin{document}
    \begin{frame}{Example}{Spy on Images in Beamer}
        \begin{tikzpicture}[spy using outlines={circle,size=.1\textwidth, magnification=3, connect spies}]
            \node[anchor=south west,inner sep=0pt] (image) at (0,0) {%
            % \includegraphics[height=.5\textwdth]{exampleA}
            \begin{tikzpicture}
                \draw[draw=blue,fill=green!50] (0,0) rectangle (.5\textwidth,.5\textwidth);
                \shade[top color=black, bottom color=white] (.25\textwidth,.25\textwidth) rectangle (.5\textwidth,.5\textwidth);                    
            \end{tikzpicture}
            };
            \begin{scope}[x={(image.south east)},y={(image.north west)}]
                % Draw besides image
                \shade[top color=red, bottom color=blue] (1.025,.66) rectangle (1.075,1);
                \node (spy1) at (128/256,192/256) {};
                \coordinate (spyto1) at (-.5,.75); 
                \spy [black,thick] on (spy1) in node at (spyto1);
                \node (spy2) at (256/256,224/256) {};
                \coordinate (spyto2) at (-.5,.25); 
                \spy [black,thick] on (spy2) in node at (spyto2);
            \end{scope}
            % Adress a point in “pixels”
        \end{tikzpicture}
\end{frame}
\end{document}

The magnification should be directly at the border of the green part to the shade. nevertheless, the magnification shows only green and playing around with the second one, i think it's off by both directions to the lower left.

Wrong spy in beamer with scopes

I have seen no way to obtain information about the magnification process, so - any clues, which computation is still affected by some wrong scoped coordinates would be very helpful.

Edit: As Andrew noted, this is fixed (also for me now) with TikZ/PGF 3.0; though if anybody could present details on what is going wrong here - feel free to share.

Ronny
  • 6,110
  • What version of TikZ are you using? It works for me with TikZ3.0. – Andrew Stacey May 09 '14 at 11:32
  • I think it's the 2.10; that one usually shipped with MacTeX 2013. – Ronny May 09 '14 at 11:39
  • Any chance of upgrading? It's really worth it. – Andrew Stacey May 09 '14 at 11:54
  • I tried just putting it into my local directory (~Library/texmf on a Mac) which didn't work yet; nevertheless I am not the only one working with these graphics; i'll try to upgrade but a solution for the 2013-TeXLive would be nice – Ronny May 09 '14 at 12:18
  • So i managed to locally install Tikz/PGF 3.0 which solves the problem for me. If you could provide your comment as an answer, i'm glad to accept it @Andrew Stacey - if you know details, even more. – Ronny May 09 '14 at 12:38
  • @LoopSpace would you like to write a quick answer for this one? – Paul Gessler Jan 10 '15 at 16:07
  • 5
    This question appears to be off-topic because it was solved by updating the pgf package. – Paul Gessler Jan 13 '15 at 04:15
  • I agree on that. For this question - though the application is quite interesting - updating resolved the problem. – Ronny Jan 13 '15 at 10:33

0 Answers0