我有一些图形结果,我需要根据以下形状来构造它们。
在第一行中,我将显示两个结果(a)和(b),在(a)图像之间没有边距并且它们位于单元格的中心,对于(b)图像和在中心,我想设置一个显著的边距来分隔每个结果。
谢谢
代码 :
\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{array}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage[margin=2cm]{geometry}
\usepackage{adjustbox}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{verbatim}
\begin{document}
\begin{figure}[h!]
{\renewcommand{\arraystretch}{0.8}
\begin{center}
\begin{tabular}{cccccc}
\includegraphics[width=2.5cm,height=2.2cm]{example-image-a} & \includegraphics[width=2.5cm,height=2.2cm]{example-image-a} & \includegraphics[width=2.5cm,height=2.2cm]{example-image-a}& \includegraphics[width=2.5cm,height=2.2cm]{example-image-a}& \includegraphics[width=2.5cm,height=2.2cm]{example-image-a} & \includegraphics[width=2.5cm,height=2.2cm]{example-image-a}\\
\multicolumn{3}{c}{(a) }& \multicolumn{3}{c}{(b)}\\
\includegraphics[width=2.5cm,height=2.2cm]{example-image-b}& \includegraphics[width=2.5cm,height=2.2cm]{example-image-b}& \includegraphics[width=2.5cm,height=2.2cm]{example-image-b}& \includegraphics[width=2.5cm,height=2.2cm]{example-image-b}& \includegraphics[width=2.5cm,height=2.2cm]{example-image-b} & \includegraphics[width=2.5cm,height=2.2cm]{example-image-b}\\
\multicolumn{3}{c}{(c) } & \multicolumn{3}{c}{(d) }\\
\includegraphics[width=2.5cm,height=2.2cm]{example-image-c}& \includegraphics[width=2.5cm,height=2.2cm]{example-image-c}& \includegraphics[width=2.5cm,height=2.2cm]{example-image-c}& \includegraphics[width=2.5cm,height=2.2cm]{example-image-c}& \includegraphics[width=2.5cm,height=2.2cm]{example-image-c} & \includegraphics[width=2.5cm,height=2.2cm]{example-image-c}\\
\multicolumn{3}{c}{(e) } & \multicolumn{3}{c}{(f) }\\
\end{tabular}
\end{center}
}
\caption{ results .} \label{fig:figure_A}
\end{figure}
\end{document}
答案1
这个答案保留了使用表格的一般方法,但稍微简化了一点:
\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{array}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage[margin=2cm]{geometry}
\usepackage{adjustbox}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{verbatim}
\begin{document}
\begin{figure}[htbp]
\centering
\renewcommand{\arraystretch}{0.8}
\begin{tabular}{ccc}
\includegraphics[width=.145\textwidth]{example-image-a}
\includegraphics[width=.145\textwidth]{example-image-a}
\includegraphics[width=.145\textwidth]{example-image-a}&&
\includegraphics[width=.145\textwidth]{example-image-a}
\includegraphics[width=.145\textwidth]{example-image-a}
\includegraphics[width=.145\textwidth]{example-image-a}\\
(a) & & (b)\\
\includegraphics[width=.145\textwidth]{example-image-a}
\includegraphics[width=.145\textwidth]{example-image-a}
\includegraphics[width=.145\textwidth]{example-image-a}&&
\includegraphics[width=.145\textwidth]{example-image-a}
\includegraphics[width=.145\textwidth]{example-image-a}
\includegraphics[width=.145\textwidth]{example-image-a}\\
(c) & & (d)\\
\includegraphics[width=.145\textwidth]{example-image-a}
\includegraphics[width=.145\textwidth]{example-image-a}
\includegraphics[width=.145\textwidth]{example-image-a}&&
\includegraphics[width=.145\textwidth]{example-image-a}
\includegraphics[width=.145\textwidth]{example-image-a}
\includegraphics[width=.145\textwidth]{example-image-a}\\
(e) & & (f)\\
\end{tabular}
\caption{results.}
\label{fig:figure_A}
\end{figure}
\end{document}
(请仅指定图像的宽度或高度,如果同时指定两者,图像将会扭曲)