答案1
根据评论,无法在 LaTeX 中制作第一个图形,因此应将其导入 pdf/svg/image 中,并在其上绘制第二个图形,如下所示:
\documentclass[tikz, border=1cm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
\begin{tikzpicture}
\node[anchor=south west, inner sep=0pt]{\includegraphics[width=10cm, height=10cm]{example-image}};
\begin{axis}[
width=10cm, height=10cm, scale only axis,
xmin=-0.1, xmax=2.6,
ymin=16, ymax=24,
]
\addplot[red, ultra thick, domain=0:2.5, samples=200] {x<0.75?4*x+20:(x<1?-26*x+42:6*x+10)};
\end{axis}
\end{tikzpicture}
\end{document}