如何在同一行中(而不是左右)显示子图(a)和(b)的代码
我曾尝试过:
\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage{pgfplots}
\usepackage{subcaption}
\begin{document}
\begin{figure}[ht]
\begin{subfigure}{.5\textwidth}
\centering
% include first image
\includegraphics[width=.5\linewidth]{image_file_name}
\caption{Put your sub-caption here}
\label{fig:sub-first}
\end{subfigure}
\begin{subfigure}{.5\textwidth}
\centering
% include second image
\includegraphics[width=.5\linewidth]{image_file_name}
\caption{Put your sub-caption here}
\label{fig:sub-second}
\end{subfigure}
\caption{Put your caption here}
\label{fig:fig}
\end{figure}
\end{document}