2

I am using subfig package to place three figures and a one rotated text side by side. Attached below is the 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}

However text is not aligned with the figure (output attached). How to fix this.

enter image description here

6
  • \rotatebox{90}{\kern-2.5cm DWAG} Feb 27, 2014 at 16:01
  • 1
    Or try \rotatebox[lb]{-90}{DWAG}. But is DWAG a sort of legend? If that is the case, you could consider using the floatrowpackage: it can put sideways caption, with many parameters (left top, left bottom, mid, distance, fontsize, &c.).
    – Bernard
    Feb 27, 2014 at 16:08
  • DWAG is a legend. But I have 15 figures (in one figure enviorment) (5 rows, 3 columns). I would like a legend per row on the side. I will checkout floatrow in any case. Thanks.
    – Kabira K
    Feb 27, 2014 at 16:24
  • @Stevens: \kern did fix the issue. Although i have to manually adjust the kern value. Not a big issue though. Works for me.
    – Kabira K
    Feb 27, 2014 at 22:54
  • @Bernard: \rotatebox[lb] gives me error
    – Kabira K
    Feb 27, 2014 at 22:55

2 Answers 2

3

You can use \raisebox from 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}

enter image description here

With \subcaptionboxfromsubcaption` package:

\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}

enter image description here

1

To give a taste of how to proceed with floatrow, here is an example. Unfortunately, a side caption for each row of a floatrow environment doesn't seem to be defined by the package, so I managed to define one according to your specification as supplementary subfigure, with an empty label and unnumbered.

    \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} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .