3 个数字并排......
我想把它们水平放置,这样你就需要将书旋转 90° 才能阅读图表和标题。
现在,我想旋转它:
\begin{figure}[]
\subfigure{
\includegraphics[width=0.28\textwidth]{figures/a.png}
}
\label{sub:graph}
\subfigure{
\includegraphics[width=0.28\textwidth]{figures/b.png}
}
\label{sub:mobile}
\subfigure{
\includegraphics[width=0.28\textwidth]{figures/c.png}
}
\label{sub:dsk}
\caption{Main cap. \ref{sub:graph} sub cap1 \ref{sub:mobile} sub cap2 and \ref{sub:desktop} sub cap3.}
\label{fig:myFig}
\end{figure}
答案1
另一种方法是使用包sidewaysfigure
中的环境rotating
。
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{rotating}
\begin{document}
\begin{sidewaysfigure}
\centering
\includegraphics[width=0.28\textheight]{figures/a.png}\quad
\includegraphics[width=0.28\textheight]{figures/b.png}\quad
\includegraphics[width=0.28\textheight]{figures/c.png}
\caption{Caption for the three rotated figures\label{fig:test}}
\end{sidewaysfigure}
\end{document}
这可以与subfig
每个图形的标题相结合:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{rotating}
\usepackage{subfig}
\begin{document}
\begin{sidewaysfigure}
\centering
\subfloat[First figure]{\includegraphics[width=0.28\textheight]{figures/a.png}\label{fig:a}} \quad
\subfloat[Second figure]{\includegraphics[width=0.28\textheight]{figures/b.png}\label{fig:b}}\quad
\subfloat[Third figure]{\includegraphics[width=0.28\textheight]{figures/c.png}\label{fig:c}}
\caption{Caption for the three rotated figures\label{fig:test}}
\end{sidewaysfigure}
\end{document}
答案2
这是一个使用浮动包裹:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{hvfloat}
\begin{document}
\hvFloat[%
nonFloat=true,%
capWidth=h,%
capPos=r,%
objectAngle=90,%
capAngle=90,%
objectPos=l%
]{figure}{%
\includegraphics[width=0.28\textheight]{figures/a.png}\quad
\includegraphics[width=0.28\textheight]{figures/b.png}\quad
\includegraphics[width=0.28\textheight]{figures/c.png}
}%
[Rotated Caption]{%
Caption for the three rotated figures}{fig:test}
\end{document}
另一个选择是使用\rotatebox
graphicx 包和一些s;可以从 caption 包中minipage
获取字幕:\captionof
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\captionsetup[subfigure]{labelformat=parens,subrefformat=parens,labelsep=space}
\begin{document}
\rotatebox{90}{%
\stepcounter{figure}%
\begin{minipage}{\textheight}
\begin{minipage}{.33\textheight}
\centering
\includegraphics[width=.9\linewidth]{figures/a.png}
\captionof{subfigure}[]{First subfigure}%
\label{sub:graph}
\end{minipage}%
\begin{minipage}{.33\textheight}
\centering
\includegraphics[width=.9\linewidth]{figures/b.png}
\captionof{subfigure}[]{Second subfigure}%
\label{sub:mobile}
\end{minipage}%
\begin{minipage}{.33\textheight}
\centering
\includegraphics[width=.9\linewidth]{figures/c.png}
\captionof{subfigure}[]{Third subfigure}%
\label{sub:desktop}
\end{minipage}%
\addtocounter{figure}{-1}%
\captionof{figure}{Main cap. \ref{sub:graph} sub cap1 \ref{sub:mobile} sub cap2 and \ref{sub:desktop} sub cap3.}
\end{minipage}%
}
\end{document}