2

Is there a way to customly change the margins only for a figure? Not for the text. I'd like to widen the margins on both sides, left and right, of the page, and keep the figure in the center.

The code I have is the following:

\begin{figure}[H]
\begin{center}
%\hspace*{-1.5in}
%\makebox[\linewidth]{
\includegraphics[scale=0.41]{result1_mnist_fc_sgd.png}
\includegraphics[scale=0.41]{result2_mnist_conv_sgd.png}
\includegraphics[scale=0.41]{result3_cifar10_sgd.png}
%}
\end{center}
\caption{Results for SGD methods}
\label{fig:NN_example}
\end{figure}

I have 3 \includegraphics in my figure, the first two I want on one line, with a wider margin, and the third image underneath it.

As can be seen in the code, I've tried \makebox and \hspace, but both don't work fine. \hspace works, but then the image is not centered anymore. \makebox puts all images on one line.

2

If the figure is inserted with \includegraphics, use \makebox[\linewidth]{\includegraphics{myfigure}. It will overflow equally on both sides, but the caption will be limited to the line width.

You also may use \includegraphics[width=\linewidth]{myfigure}, in order to reduce the size of the figure.

  • Thanks! However, this does not work as I like. I namely have 3 \includegraphics in my figure, the first two I want on one line, with a wider margin, and the third image underneath it. I'll post the code in the question to give an idea. – Frans Aug 20 '15 at 12:07
  • @Frans just put the first two in the makebox then a blank line then the third. – David Carlisle Aug 20 '15 at 12:13
  • Cheers mate! That seems to work! – Frans Aug 20 '15 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.