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.

pinline end a little bit closer to the "magnified" solution's axis? – Philipp Jan 28 '12 at 16:40xlabel style={overlay}) or we can change the angle in which the pin points to its node (likepin=180:...). – Christian Feuersänger Jan 28 '12 at 18:29every pin. If you want to keep the white color inside of the rectangle and get rid of the outer space, you should ask a separate question as this requires more bounding box control. – Christian Feuersänger Sep 27 '16 at 18:45