我计划在图片左侧添加一些标题。这是我的代码:
\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}
图像如下:
我希望我的形象是这样的:
答案1
该方法测量每幅图像的高度并用于\makebox
使旋转的文本居中。
\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}
这种方法使用表格。它指定每个图像的高度而不是宽度。
\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}