I want to zoom into a plot much like it is possible by using the spy
library but I want the spy-in node to contain its own ticks and tick labels with a finer grid than the original plot. To clarify what I mean I prepared the following picture by editing a picture that was produced with pgfplots
and the spy
library with the program Inkscape:
Here is the code for the "pgfplots
and spy
"-part of the picture:
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{width=10cm,compat=newest}
\usepgfplotslibrary{units}
\usetikzlibrary{spy,backgrounds}
\usepackage{pgfplotstable}
\pgfplotstableread{
0.0 1.0
0.0 -0.5
}\datatable
\begin{document}
\begin{tikzpicture} [spy using outlines={rectangle, magnification=2, size=0.5cm, connect spies}]
\begin{axis}[
xlabel={Energy},
ylabel={Intensity},
x unit={eV}
]
\addplot +[mark=none] table [x index=0, y index=1] {\datatable};
\addplot +[mark=none] {0.1*x^2};
\begin{scope}
\spy[black,size=2cm] on (4.25,1.65) in node [fill=none] at (5,5.5);
\end{scope}
\end{axis}
\end{tikzpicture}
\end{document}
I'm not sure whether this is possible using the spy
library or not. Maybe another approach is needed to achieve this.