Graphics, Figures & TablesSubfigures with caption on side

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
pemfir
Posts: 23
Joined: Sun Aug 12, 2012 11:30 pm

Subfigures with caption on side

Post by pemfir »

Hi,
Each sub-figure is typically assigned a letter like (a),(b),(c) each indicating a figure inside a sub figure.
Is there anyway to place these letters on the side of the figure instead of on the top or bottom ?

Code: Select all

\begin{figure}[h!]
%\begin{tabular}{c}
        \begin{subfigure}[b]{.5\textwidth}
%                \centering
                \includegraphics[width=\textwidth]{image3}
                \caption{}
                \label{fig:taylor}
        \end{subfigure}%
\\
        \begin{subfigure}[b]{.5\textwidth}
%                \centering
                \includegraphics[width=\textwidth]{image4}
                \caption{}
                \label{fig:upper}
        \end{subfigure}
\\
        \begin{subfigure}[b]{.5\textwidth}
%                \centering
                \includegraphics[width=\textwidth]{image5}
                \caption{A mouse}
                \label{fig:mouse}
        \end{subfigure}
         \caption{End-of-mission energy prediction}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Subfigures with caption on side

Post by sommerfee »

This one surely needs to be improved but could be taken for a start:

Code: Select all

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\captionsetup[subfigure]{slc=off,margin={1cm,0cm}}
  \parbox[b]{0.5\textwidth}{\includegraphics[width=\hsize]{image3}}%
  \parbox[b]{0.5\textwidth}{\subcaption{}}\\[1ex]
  \parbox[b]{0.5\textwidth}{\includegraphics[width=\hsize]{image4}}%
  \parbox[b]{0.5\textwidth}{\subcaption{}\label{fig:upper}}\\[1ex]
  \parbox[b]{0.5\textwidth}{\includegraphics[width=\hsize]{image5}}%
  \parbox[b]{0.5\textwidth}{\subcaption{A mouse}\label{fig:mouse}}
  \caption{End-of-mission energy prediction}
\end{figure}
\end{document}
As an alternative take a look at the floatrow package which can handle things like this in a more elegant way.
pemfir
Posts: 23
Joined: Sun Aug 12, 2012 11:30 pm

Re: Subfigures with caption on side

Post by pemfir »

Thank you very much
Post Reply