我使用的代码是:
\usepackage{subfigure}
\begin{document}
\begin{figure}[h!]
\centering
\subfloat[NACA airfoil 0012]{
\includegraphics[width=0.15\textwidth]{12}}
\subfloat[NACA airfoil 4420]{
\includegraphics[width=0.15\textwidth]{4420}}
\subfloat[NACA airfoil 4414]{
\includegraphics[width=0.15\textwidth]{4414}}
\subfloat[NACA airfoil 5122]{
\includegraphics[width=0.15\textwidth]{5122}}
\caption{QBlade wind turbine blades}
\end{figure}
\end{document}
感谢大家!
答案1
一般评论:该subfigure
软件包已弃用。不要使用它!相反,请使用该subfig
软件包。
我的主要建议是使用三个\hfill
指令来最大化四个子图之间的分离。
\documentclass[twoside,twocolumn,11pt,demo]{article}
% remove 'demo' option in real document
\usepackage{graphicx} % for '\includegraphics' macro
\usepackage{subfig} % for `\subfloat` macro
\begin{document}
\begin{figure*}[h!]
\subfloat[NACA airfoil 0012]{%
\includegraphics[width=0.15\textwidth]{12}}\hfill
\subfloat[NACA airfoil 4420]{%
\includegraphics[width=0.15\textwidth]{4420}}\hfill
\subfloat[NACA airfoil 4414]{%
\includegraphics[width=0.15\textwidth]{4414}}\hfill
\subfloat[NACA airfoil 5122]{%
\includegraphics[width=0.15\textwidth]{5122}}
\caption{QBlade wind turbine blades}
\end{figure*}
\end{document}
答案2
您可以使用subcaption
它来更轻松地将子图的宽度与封闭子浮点数的宽度分离。
这里我使用线宽的五分之一的子浮点数(所以图形缩放到 0.3 而不是 0.15)。
\documentclass{article}
\usepackage{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htp]
\centering
\begin{subfigure}{0.2\textwidth}
\centering
\includegraphics[width=0.3\linewidth]{example-image-9x16}
\caption{NACA airfoil 0012}
\end{subfigure}\hfill
\begin{subfigure}{0.2\textwidth}
\centering
\includegraphics[width=0.3\linewidth]{example-image-9x16}
\caption{NACA airfoil 4420}
\end{subfigure}\hfill
\begin{subfigure}{0.2\textwidth}
\centering
\includegraphics[width=0.3\linewidth]{example-image-9x16}
\caption{NACA airfoil 4414}
\end{subfigure}\hfill
\begin{subfigure}{0.2\textwidth}
\centering
\includegraphics[width=0.3\linewidth]{example-image-9x16}
\caption{NACA airfoil 5122}
\end{subfigure}
\caption{QBlade wind turbine blades}
\end{figure}
\end{document}