旋转文本和图形并垂直对齐

旋转文本和图形并垂直对齐

我正在使用 subfig 包将三个图形和一个旋转的文本并排放置。下面附有 mwe

\documentclass[draft]{article}
\usepackage{subfig}
\usepackage[demo]{graphicx}
\begin{document}

\begin{figure*}[ht!]
 \captionsetup[subfigure]{labelformat=empty}

 \subfloat[]{
   \includegraphics[width=1.50in,height=1.50in,angle=-90]{fig1.pdf}
}\hspace{-1em}
 \subfloat[]{
   \includegraphics[width=1.50in,height=1.50in,angle=-90]{fig2.pdf}
}\hspace{-2em}
 \subfloat[]{
   \includegraphics[width=1.50in,height=1.50in,angle=-90]{fig3.pdf}
}
\subfloat[]{
   \rotatebox{90}{DWAG}
}
\end{figure*}
\end{document}

但是文本与图形不对齐(附输出)。如何修复此问题。

在此处输入图片描述

答案1

您可以使用\raisebox来自graphicx

\documentclass[draft]{article}
\usepackage{subfig}
\usepackage[demo]{graphicx}
\begin{document}

\begin{figure*}[ht!]
 \captionsetup[subfigure]{labelformat=empty}

 \subfloat[]{
   \includegraphics[width=1.50in,height=1.50in,angle=-90]{fig1.pdf}
}\hspace{-1em}
 \subfloat[]{
   \includegraphics[width=1.50in,height=1.50in,angle=-90]{fig2.pdf}
}\hspace{-2em}
 \subfloat[]{
   \includegraphics[width=1.50in,height=1.50in,angle=-90]{fig3.pdf}
}
\subfloat[]{
   \raisebox{-0.75in}{\rotatebox[origin=t]{90}{DWAG}}   %%% 0.75in is half of figure height 1.5in
}

\end{figure*}
\end{document}

在此处输入图片描述

使用 \subcaptionbox fromsubcaption` 包:

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

\begin{document}

\begin{figure}[htb]
\centering
\subcaptionbox{}{\includegraphics[width=1.50in,height=1.50in,angle=-90]{fig1.pdf}}
\subcaptionbox{}{\includegraphics[width=1.50in,height=1.50in,angle=-90]{fig2.pdf}}
\subcaptionbox{}{\includegraphics[width=1.50in,height=1.50in,angle=-90]{fig3.pdf}}
\subcaptionbox{}{\rotatebox[origin=t]{90}{DWAG}}
\end{figure}

\end{document}

在此处输入图片描述

答案2

为了让您了解如何使用floatrow,这里有一个示例。不幸的是,该包似乎没有定义 floatrow 环境每行的侧面标题,因此我设法根据您的规范定义了一个补充子图,带有一个空标签且未编号。

    \documentclass{article}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{lmodern}

    \usepackage[textwidth = 18cm, nomarginpar, showframe]{geometry}
    \usepackage[font=footnotesize]{subcaption}
    \usepackage[draft]{graphicx}

    \usepackage{floatrow}
    \DeclareFloatVCode{somespace}{\vspace{1.667\baselineskip}}
    \floatsetup[figure]{rowpostcode = somespace, capposition = beside}

    \newcommand*\nocaption{\captionsetup{labelformat = empty, list = no}\caption{}}
    \newcommand*\rowlegend[{1}]{\thisfloatsetup{floatwidth = 0cm}%
    \ffigbox{\llap{\rotatebox{90}{#1}}}%
    {\nocaption\addtocounter{figure}{-1}}}%

    \begin{document}

    \begin{figure}[!ht]
    \centering
    \begin{floatrow}[4]
    \ffigbox{%
    \includegraphics[scale=0.6]{zoom}}%
    {\caption{workflow $S1$}\label{fig: wfs1}}%
    %
    \ffigbox{%
    \includegraphics[scale=0.6]{zoom}}%
    {\caption{workflow $S2$}\label{fig: wfs2}}%
    %
    \ffigbox{%
    \includegraphics[scale=0.6]{zoom}}%
    {\caption{workflow $S3$}\label{fig: wfs3}}%
    %
    \ffigbox{%
    \includegraphics[scale=0.6]{zoom}}%
    {\caption{workflow $S4$}\label{fig: wfs4}}%
    %
    \rowlegend{\LARGE DWAG}
    \end{floatrow}%
    %%%
    \begin{floatrow}[4]
    \ffigbox{%
    \includegraphics[scale=0.6]{zoom}}%
    {\caption{workflow $S5$}\label{fig: wfs5}}%
    %
    \ffigbox{%
    \includegraphics[scale=0.6]{zoom}}%
    {\caption{workflow $S6$}\label{fig: wfs6}}%
    %
    \ffigbox{%
    \includegraphics[scale=0.6]{zoom}}%
    {\caption{workflow $S7$}\label{fig: wfs7}}%
    %
    \ffigbox{%
    \includegraphics[scale=0.6]{zoom}}%
    {\caption{workflow $S8$}\label{fig: wfs8}}%
    %
    \rowlegend{\LARGE GAWD}
    \end{floatrow}%
    \end{figure}

    \end{document} 

在此处输入图片描述

相关内容