I am trying to create an environment for plotting two figures side-by-side:
\begin{figure}[t]
\begin{minipage}[b]{0.49\textwidth}
\flushleft
\psfragfig[frame,mode=nonstop]{Plot_random_Breite_05_1}
\caption{Figur Nr. 8a}
\label{fig:8a}
\end{minipage}
\hspace*{14pt}% separation between the subfigures
\begin{minipage}[b]{0.49\textwidth}
\flushleft
\psfragfig[frame,mode=nonstop]{Plot_random_Breite_05_2}
\caption{Figur Nr. 8b}
\label{fig:8b}
\end{minipage}
\end{figure}
Unfortunately I get an "Overfull hbox" warning.
I tried several things to remove this warning:
- remove
\hspace - smaller width (
0.4\textwidth) \linewidthinstead of\textwidthsubfigureinstead ofminipage
Nothing helped. The plot is not scaled, the textwidth is about 9cm and the size of the plot is about 3cm.
Has someone an idea? Can't figure out where the bug is -.-
If I use \hfill as recommended below, my code and the output look like this:
\begin{figure}[t]
\begin{minipage}[b]{0.49\textwidth}
\raggedright
\psfragfig[frame,mode=nonstop]{Plot_random_Breite_05_1}
\caption{Figur Nr. 8a}
\label{fig:8a}
\end{minipage}\hfill
\begin{minipage}[b]{0.49\textwidth}
\raggedleft
\psfragfig[frame,mode=nonstop]{Plot_random_Breite_05_2}
\caption{Figur Nr. 8b}
\label{fig:8b}
\end{minipage}
\end{figure}
As you can see I would prefer, if both picture align with the margins.
Is there a way to align the second caption with the frame of the plot?



\end{minipage}) and 14pt. Remove\hspace*{14pt}and put\hfillafter\end{minipage}(same line, no space in between). By the way you should use\raggedright, not\flushleft. – egreg Mar 15 '16 at 22:03\includegraphics[]{example-image}which is an image in most distributions, to make your example portable. – David Carlisle Mar 15 '16 at 23:36