在一行上显示两张图片并使它们居中的最佳方法是什么?这是我到目前为止尝试过的,但它显示的图像彼此相距很远
\begin{figure}[!htb]
\minipage{0.32\textwidth}
\begin{center}
\includegraphics[width=\linewidth, height = 1.25in]{loss_test}
\end{center}
\caption{Test loss}
\endminipage\hfill
\minipage{0.32\textwidth}
\includegraphics[width=\linewidth, height = 1.25in]{accuracy_test}
\caption{Test accuracy}
\endminipage
\end{figure}
答案1
尝试(正如大卫卡莱尔在他的评论中提到的):
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[!htb]
\centering
\begin{minipage}{0.32\textwidth}
\includegraphics[width=\linewidth, height = 1.25in]{example-image-a}
\caption{Test loss}
\end{minipage}\hfil
\begin{minipage}{0.32\textwidth}
\includegraphics[width=\linewidth, height = 1.25in]{example-image-b}
\caption{Test loss}
\end{minipage}\hfil
\end{figure}
\end{document}