我想要按如下方式移动子图的位置。
- 将面板 3 的图形移至面板 2 的图形下方;
- 将标题移至第 1 面板图下方;如果可能的话
- 将子标题与每个子图的左侧对齐。
我怎样才能实现这些目标?
\documentclass[a4paper,11pt]{report}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{tabularx}
\usepackage{caption}
\newcommand\mycaption[2]{\caption{\textbf{#1}\newline\footnotesize#2}}
\captionsetup{font=small, labelfont=bf, singlelinecheck=false, tableposition=bottom, justification=justified}
\begin{document}
% test
\begin{figure}[t!]
\centering
\captionsetup{width=0.5\linewidth}
\subfloat[Panel 1]{
\label{fig1}
\includegraphics[clip,width=0.45\columnwidth]{example-image}}%
\quad
\subfloat[Panel 2]{
\label{fig2}
\includegraphics[clip,width=0.45\columnwidth]{example-image}}%
\hfill
\subfloat[Panel 3]{
\label{fig3}
\includegraphics[clip,width=0.45\columnwidth]{example-image}}%
\mycaption{PPC eigenvectors.}{I want to place Panel 3 figure below Panel 2 figure.
Then write the captions next to Panel 3 (below Panel 1). If possible, I would also like to align the subfigure labels at the left of a image.}
\label{fig}
\end{figure}
\end{document}
答案1
{
首先,(几乎)每次你用或结束一行时,}
你都会添加一个空格。具体来说,你会在图像前添加两个空格。
其次,您可以将 放入\caption
迷你页面以减少宽度。使用 设置宽度\captionsetup
没有帮助,因为\caption
以 开头和结尾\par
。
第三,我使用保存框来防止重置子图计数器。也可以使用\setcounter{subfigure}{2}
。,保存框还可用于帮助调整对齐方式(如果需要)。
\documentclass[a4paper,11pt]{report}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{subcaption}
\newcommand\mycaption[2]{\caption{\textbf{#1}\newline\footnotesize#2}}
\captionsetup{font=small, labelfont=bf, singlelinecheck=false, tableposition=bottom, justification=justified}
\begin{document}
% test
\begin{figure}[t!]
\centering
\subfloat[Panel 1\label{fig1}]{%
\includegraphics[clip,width=0.45\columnwidth]{example-image}}%
\hfil
\subfloat[Panel 2\label{fig2}]{%
\includegraphics[clip,width=0.45\columnwidth]{example-image}}%
\vskip\floatsep
\sbox0{%
\subfloat[Panel 3\label{fig3}]{% measuer width and height
\includegraphics[clip,width=0.45\columnwidth]{example-image}}%
}%
\begin{minipage}[b]{0.45\columnwidth}%
\mycaption{PPC eigenvectors.}{I want to place Panel 3 figure below Panel 2 figure.
Then write the captions next to Panel 3 (below Panel 1). If possible, I would also like to align the subfigure labels at the left of a image.}
\label{fig}
\end{minipage}
\hfil
\usebox0
\end{figure}
\end{document}