von esdd » Mo 7. Nov 2016, 22:17
pgfplots lädt sowieso
graphicx und die Option pdftex lässt Du besser ganz weg. Dafür sollte man durch Setzen von compat immer eine Kompatibilitätseinstellung für pgfplots vornehmen, sonst wird automatisch Kompatibilität zu pre1.3 hergestellt.
Mir erschließt sich nicht, warum man hinter ein Diagramm noch ein Bild setzen soll, aber möglich ist das natürlich. Wie genau hängt u.a. davon ab, welche Optionen man sonst noch für die axis setzt und ob man layer verwendet.
Eine einfache Möglichkeit für Dein Beispiel wäre
\documentclass[12pt,titlepage,a4paper]{report}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot coordinates {( 338.1, 266.45 )( 169.1, 143.43 )( 84.5, 64.80 )( 42.3, 34.19 )( 21.1, 9.47 )};
\node at (current axis.center){%
\includegraphics[
width=\dimexpr\axisdefaultwidth-45pt\relax,
height=\dimexpr\axisdefaultheight-45pt\relax
]{example-image}};
\end{axis}
\end{tikzpicture}
\end{document}
[p]pgfplots[/p] lädt sowieso [p]graphicx[/p] und die Option [tt]pdftex[/tt] lässt Du besser ganz weg. Dafür sollte man durch Setzen von [tt]compat[/tt] immer eine Kompatibilitätseinstellung für [tt]pgfplots[/tt] vornehmen, sonst wird automatisch Kompatibilität zu [tt]pre1.3[/tt] hergestellt.
Mir erschließt sich nicht, warum man hinter ein Diagramm noch ein Bild setzen soll, aber möglich ist das natürlich. Wie genau hängt u.a. davon ab, welche Optionen man sonst noch für die [tt]axis[/tt] setzt und ob man [tt]layer[/tt] verwendet.
Eine einfache Möglichkeit für Dein Beispiel wäre
[code]\documentclass[12pt,titlepage,a4paper]{report}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot coordinates {( 338.1, 266.45 )( 169.1, 143.43 )( 84.5, 64.80 )( 42.3, 34.19 )( 21.1, 9.47 )};
\node at (current axis.center){%
\includegraphics[
width=\dimexpr\axisdefaultwidth-45pt\relax,
height=\dimexpr\axisdefaultheight-45pt\relax
]{example-image}};
\end{axis}
\end{tikzpicture}
\end{document}[/code]