请帮助我将这两个图形制作成子图;

请帮助我将这两个图形制作成子图;
\begin{figure}[]
\centering
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.5\textwidth]{Speed_torque_healthyandfaulty.eps}};
\node[anchor=south west,inner sep=0] (image) at (3.7,1.5) {\includegraphics[width=0.18\textwidth]{Speed_torque_healthyandfaulty_zoomed.eps}};
\end{tikzpicture}
\caption{torque}
\end{figure}

\begin{figure}[]
\centering
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.48\textwidth]{Speed_healthyandfaulty.eps}};
\node[anchor=south west,inner sep=0] (image) at (1.8,1.5) {\includegraphics[width=0.2\textwidth]{Speed_healthyandfaulty_zoomed.eps}};
\end{tikzpicture}
\caption{torque!}
\end{figure}

答案1

在此处输入图片描述

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{tikz}
\usepackage{subcaption}

\begin{document}
    \begin{figure}[ht] 
\begin{subfigure}{\linewidth}
    \centering
\begin{tikzpicture} 
\node[anchor=south west,inner sep=0] (image) at (0,0)
    {\includegraphics[width=0.5\textwidth]{Speed_torque_healthyandfaulty.eps}}; 
\node[anchor=south west,inner sep=0] (image) at (3.7,1.5)
    {\includegraphics[width=0.18\textwidth]{Speed_torque_healthyandfaulty_zoomed.eps}};
\end{tikzpicture} 
\caption{torque}
\end{subfigure}

\begin{subfigure}{\linewidth}
\centering 
\begin{tikzpicture} 
\node[anchor=south west,inner sep=0] (image) at (0,0)
    {\includegraphics[width=0.48\textwidth]{Speed_healthyandfaulty.eps}}; 
\node[anchor=south west,inner sep=0] (image) at (1.8,1.5)
    {\includegraphics[width=0.2\textwidth]{Speed_healthyandfaulty_zoomed.eps}}; \end{tikzpicture} \caption{torque!}
\end{subfigure}
\caption{figures}
\end{figure}
\end{document}

或者

在此处输入图片描述

    \begin{figure}[ht] 
\begin{subfigure}{0.5\linewidth}
    \centering
\begin{tikzpicture} 
\node[anchor=south west,inner sep=0] (image) at (0,0)
    {\includegraphics[width=\textwidth]{Speed_torque_healthyandfaulty.eps}}; 
\node[anchor=south west,inner sep=0] (image) at (3.7,1.5)
    {\includegraphics[width=0.36\textwidth]{Speed_torque_healthyandfaulty_zoomed.eps}};
\end{tikzpicture} 
\caption{torque}
\end{subfigure}
%
\begin{subfigure}{0.5\linewidth}
\centering 
\begin{tikzpicture} 
\node[anchor=south west,inner sep=0] (image) at (0,0)
    {\includegraphics[width=0.96\textwidth]{Speed_healthyandfaulty.eps}}; 
\node[anchor=south west,inner sep=0] (image) at (1.8,1.5)
    {\includegraphics[width=0.4\textwidth]{Speed_healthyandfaulty_zoomed.eps}}; \end{tikzpicture} \caption{torque!}
\end{subfigure}
\caption{figures}
    \end{figure}

相关内容