[Tex/LaTex] Reducing margin as small as possible in subfigure

marginssubfloats

I use subfigure to implement subfigure and I use \hspace or \vspace. I want very small margin to maximize the size of subfigures but when I set \hspace{0cm} and \vspace{0cm}, there is still large enough margin left between 2 subfigures hence I can not maximize subfigure size. How to solve this problem? My code is like this :

\begin{figure}[t]
\centering

\subfigure[11a's TX rate]{
\includegraphics[scale =0.25] {fig/cdf_rate11a.eps}
\label{cdf_rate11a}
}
\hspace{0cm}
\subfigure[11n's TX rate]{
\includegraphics[scale =0.25] {fig/cdf_rate11n.eps}
\label{cdf_rate11n}
}

\caption{Coverage comparison in various location}
\label{coverage_comparison}
\end{figure}

Best Answer

If I understand your objective correctly, you're looking to place two subfigures side by side. In order to maximize their size, while also maximizing the available distance between them, don't specify a scale option in the \includegraphics instructions. Instead, specify a large value for the width of each subfigure environment -- e.g., 0.48\textwidth -- and use the width=\linewidth option when executing \includegraphics. And, be sure to use an instruction such as \hspace{\fill} to maximize the separation between the subfigures.

The following image shows the resulting look. The thin horizontal line on top is drawn just to illustrate the width of the text block.

enter image description here

\documentclass{report}
\usepackage{subcaption}      % for 'subfigure'  environment
\usepackage[demo]{graphicx}  % omit 'demo' in your real document
\begin{document}
\hrule % just to illustrate the width of the text block
\begin{figure}[h!]
%%\centering  % not needed as the subfigures are maximally separated

\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\linewidth]{fig/cdf_rate11a.eps}
\caption{11a's TX rate}
\label{fig:cdf_rate11a}
\end{subfigure}
\hspace*{\fill}
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\linewidth]{fig/cdf_rate11n.eps}
\caption{11n's TX rate}
\label{fig:cdf_rate11n}
\end{subfigure}

\caption{Coverage comparison in various locations}
\label{fig:coverage_comparison}
\end{figure}
\end{document}
Related Question