我的 tex 文件中包含多个图形。我的 tex 代码是:
\documentclass[a4paper]{article}
\usepackage[pdftex]{graphicx}
\begin{document}
\begin{figure}[h]
\centering
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=0.7\linewidth]{1.jpg}
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=0.7\linewidth]{1.jpg}
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=0.7\linewidth]{1.jpg}
\caption{Test}
\label{figTest}
\end{figure}
\end{document}
输出如下:
现在我想将另外两张图片作为三张图片组的水平标题和垂直标题。水平和垂直标题如下:
我希望输出如下:
这在 LaTeX 中可以实现吗?如果可以,请问如何实现?
答案1
有以下几种可能性可以实现这一点:
- 使用图形文件作为侧面/底部面板(更改宽度/高度以适合文件尺寸的适当设置(我不知道)
- 使用直接字体方法,即使用文本作为侧面/底部图例
\documentclass[a4paper]{article}
\usepackage[demo]{graphicx}
\usepackage{multirow}
\begin{document}
\begin{figure}[h]
\centering
\begin{tabular}{c@{}c@{}}
\multirow{-6}{*}{\includegraphics[height=1cm,angle=90]{vertical.jpg}}
&
\begin{tabular}{l}
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=0.7\linewidth]{1.jpg} \tabularnewline
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=0.7\linewidth]{1.jpg} \tabularnewline
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=0.7\linewidth]{1.jpg} \tabularnewline
\end{tabular} \tabularnewline
& \multicolumn{1}{c}{\includegraphics[width=0.4\linewidth,height=1cm]{horizontal.jpg}}
\end{tabular}
\caption{Test}
\label{figTest}
\end{figure}
\begin{figure}[h]
\centering
\begin{tabular}{c@{}c@{}}
\multirow{-4}{*}{\rotatebox{90}{\LARGE \bfseries Error (mm)}}
&
\begin{tabular}{l}
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=0.7\linewidth]{1.jpg} \tabularnewline
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=0.7\linewidth]{1.jpg} \tabularnewline
\includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width=0.7\linewidth]{1.jpg} \tabularnewline
\end{tabular} \tabularnewline
& \tabularnewline
& \LARGE \bfseries Time (s) \tabularnewline
\end{tabular}
\caption{Other Test}
\label{figOtherTest}
\end{figure}
\end{document}
答案2
无需花哨的包装:
\documentclass[a4paper]{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htp]
\centering
\makebox[0pt][r]{\rotatebox[origin=c]{90}{%
\hspace{.5cm}%
\includegraphics[height=.5cm,width=3cm]{example-image}%
}\hspace{.2cm}}%
\begin{tabular}{c@{}}
\includegraphics[height=2cm,width=0.7\linewidth]{example-image-a} \\
\includegraphics[height=2cm,width=0.7\linewidth]{example-image-b} \\
\includegraphics[height=2cm,width=0.7\linewidth]{example-image-c} \\
\includegraphics[height=.5cm,width=3cm]{example-image}
\end{tabular}
\caption{Test}\label{figTest}
\end{figure}
\end{document}