1

I am planning to add some captions and the left of my image. This is my code:

\begin{figure}
\begin{subfigure}{0.235\textwidth}
\centering
\rotatebox{90}{\hspace{0.5cm}$R=1$}
\includegraphics[width=.8\linewidth]{LTC0_25.png}
\centering
\rotatebox{90}{\hspace{1cm}$R=1$}
\includegraphics[width=.8\linewidth]{LTC0_5.png}
\centering
\rotatebox{90}{\hspace{1.5cm}$R=1$}
\includegraphics[width=.8\linewidth]{LTC0_75.png}
\centering
\rotatebox{90}{\hspace{2cm}$R=1$}
\includegraphics[width=.8\linewidth]{LTC0_97.png}
\caption{Analytic}
\end{subfigure}%
\begin{subfigure}{.235\textwidth}
\centering
\includegraphics[width=.8\linewidth]{ray0_25.png}
\centering
\includegraphics[width=.8\linewidth]{ray0_5.png}
\centering
\includegraphics[width=.8\linewidth]{ray0_75.png}
\centering
\includegraphics[width=.8\linewidth]{ray0_97.png}
\caption{Ray-traced}
\end{subfigure}
\caption{Comparisons between analytic results and ray-traced results}
\label{fig:fig}
\end{figure}  

And the image is:

enter image description here

I want my image to be like:

enter image description here

1 Answer 1

1

This approach measures the height of each image and uses \makebox to center the rotated text.

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

\begin{document}
\begin{figure}
\centering
\begin{subfigure}{.235\textwidth}
\centering
\sbox0{\includegraphics[width=.8\linewidth]{LTC0_25.png}}%
\rotatebox[origin=Bl]{90}{\makebox[\wd0][c]{$R=1$}}
\usebox0

\sbox0{\includegraphics[width=.8\linewidth]{LTC0_5.png}}%
\rotatebox[origin=Bl]{90}{\makebox[\wd0][c]{$R=1$}}
\usebox0

\sbox0{\includegraphics[width=.8\linewidth]{LTC0_75.png}}%
\rotatebox[origin=Bl]{90}{\makebox[\wd0][c]{$R=1$}}
\usebox0

\sbox0{\includegraphics[width=.8\linewidth]{LTC0_97.png}}%
\rotatebox[origin=Bl]{90}{\makebox[\wd0][c]{$R=1$}}
\usebox0

\caption{Analytic}
\end{subfigure}%
\begin{subfigure}{.235\textwidth}
\centering
\includegraphics[width=.8\linewidth]{ray0_25.png}

\includegraphics[width=.8\linewidth]{ray0_5.png}

\includegraphics[width=.8\linewidth]{ray0_75.png}

\includegraphics[width=.8\linewidth]{ray0_97.png}
\caption{Ray-traced}
\end{subfigure}
\caption{Comparisons between analytic results and ray-traced results}
\label{fig:fig}
\end{figure}  
\end{document}

This approach uses a tabular. It specifies the height of each image instead of the width.

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

\newlength{\tempdima}

\begin{document}
\begin{figure}
\setlength{\tempdima}{2.5cm}% specify height
\centering
\begin{tabular}{rcc}
\rotatebox[origin=Bl]{90}{\makebox[\tempdima][c]{$R=1$}} &
\includegraphics[height=\tempdima]{LTC0_25.png} &
\includegraphics[height=\tempdima]{ray0_25.png}\\
\rotatebox[origin=Bl]{90}{\makebox[\tempdima][c]{$R=1$}} &
\includegraphics[height=\tempdima]{LTC0_5.png} &
\includegraphics[height=\tempdima]{ray0_5.png} \\
\rotatebox[origin=Bl]{90}{\makebox[\tempdima][c]{$R=1$}} &
\includegraphics[height=\tempdima]{LTC0_75.png} &
\includegraphics[height=\tempdima]{ray0_75.png} \\
\sbox0{}%
\rotatebox[origin=Bl]{90}{\makebox[\tempdima][c]{$R=1$}} &
\includegraphics[height=\tempdima]{LTC0_97.png} &
\includegraphics[height=\tempdima]{ray0_97.png} \\
& (a) Analytic & (b) Ray-traced
\end{tabular}
\caption{Comparisons between analytic results and ray-traced results}
\label{fig:fig}
\end{figure}  
\end{document}

You must log in to answer this question.

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