3

I want to add vertical (rotated) text at the beginning of a row of subfigures using the subcaption package. My solution right now is to create a separate subfigure:

\documentclass{article}

\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{figure}
  \begin{subfigure}{1in}
    \rotatebox{90}{\makebox[2in]{center}}
    \captionsetup{skip=0pt}
    \caption{}
  \end{subfigure}%
  \quad
  \begin{subfigure}{1in}
    \rule{1in}{2in}
    \captionsetup{skip=0pt}
    \caption{}
  \end{subfigure}%
  \quad
  \begin{subfigure}{1in}
    \rule{1in}{2in}
    \captionsetup{skip=0pt}
    \caption{}
  \end{subfigure}
\end{figure}

\end{document}

which works fine except that I don't want any caption for the vertical text. However if I remove the "\caption{}" line then the text is no longer vertically aligned with the two subfigures. Is there a better way to do this?

  • 1
    There might be a simpler alternative, but you could use the starred version for the first caption: \caption*{}. – Gonzalo Medina Nov 14 '14 at 17:56
2

Using the origin=c option to \rotatebox will give text that is vertically centered without the use of an extra subfigure. Alternatively you can [t] align the subfigures are rotate with origin=l:

origin=c:

Sample output

origin=l and subfigures with [t]:

Second sample

\documentclass{article}

\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{figure}
  \rotatebox[origin=c]{90}{\makebox[2in]{center}}%
  \quad
  \begin{subfigure}{1in}
    \rule{1in}{2in}
    \caption{}
  \end{subfigure}%
  \quad
  \begin{subfigure}{1in}
    \rule{1in}{2in}
    \caption{}
  \end{subfigure}
\end{figure}

\begin{figure}
  \rotatebox[origin=l]{90}{\makebox[2in]{center}}%
  \quad
  \begin{subfigure}[t]{1in}
    \rule{1in}{2in}
    \caption{}
  \end{subfigure}%
  \quad
  \begin{subfigure}[t]{1in}
    \rule{1in}{2in}
    \caption{}
  \end{subfigure}
\end{figure}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.