3

I am writing a double-columned article. I am having a problem that one particular figure covers some of the text above and another figure across the column. See following picture:

enter image description here

I did a lot of search, but all talk about making the figure "background". Well I don't want to make it background, I would just like to "send it to the back".

How can I make this particular figure "under" the text above, and the figure across the column? Thanks a lot.

Here is my figure insertion code:

\vspace{-1cm}
\begin{figure}[h]
\hspace{-0.9cm}
\vspace{-1cm}
\includegraphics[scale=0.27]{../figures/lin_regression.png}
\caption{Regressions of phase rolls.}
\label{fig_lin_regression}
\end{figure}
  • 2
    latex doesn't have a layered output you need to set backgrouund things before foreground. But why have you got negative spacing? especially the negative space before the figure is very odd as if the figure floats to another position the negative space will make the next paragraph of text overprint the previous one, – David Carlisle Nov 20 '18 at 19:26
  • This may be of interest: https://tex.stackexchange.com/q/156903/105447 – gusbrs Nov 20 '18 at 19:27
  • I'd like to have a lager figure, but the margin of the figure is relatively large. So if I have a large figure and if I have a non-negtive spacing, then the figure goes out of boundary. – Nick X Tsui Nov 20 '18 at 19:28
  • @gusbrs Yeah.... but like I said in the thread, I do not want to make my image background...... – Nick X Tsui Nov 20 '18 at 19:29
  • 1
    but negative vspace is just forcing the problem you have. you have 2cm of negative space before the figure, are you saying that the png image has a 2cm white space at the top? in any case you should use the clip option to trim the figure not use negative space – David Carlisle Nov 20 '18 at 19:29
  • @DavidCarlisle OK, I guess clip is the solution then. – Nick X Tsui Nov 20 '18 at 19:30
  • unrelated but don't use [h] it makes it highly likely that the figure floats to the end of the document, usually latex warns and changes it to [ht] but [htp] is better – David Carlisle Nov 20 '18 at 19:32
  • @DavidCarlisle OK. Thanks David. Pleas post your clip suggestion as answer. I quickly tried it, and it gives me what I want. – Nick X Tsui Nov 20 '18 at 19:38
  • Beside to clip properly the image, do not use scale=0.27 but width=\linewidth that ensure that you image will fit perfectly in the column, whatever the original image size, and without using any \hspace. – Fran Nov 20 '18 at 20:32

1 Answers1

2

The negative spacing is forcing the overprinting, Also since figure is a float, the \vspace before the figure is completely wrong as if the figure floats the \vspace will still be in that place and cause the following text to overprint the preceding text.

If there is a white margin in the png, trim it with an external graphics editor or use the trim or clip options to \includegraphics also it is almost always best to include p or it is highly likely the float will go to the end of the document, so

\begin{figure}[htp]
\includegraphics[scale=0.27,clip= 20 20 500 500 ]{../figures/lin_regression.png}
\caption{Regressions of phase rolls.}
\label{fig_lin_regression}
\end{figure}

using whatever clip box coordinates make sense in your case.

David Carlisle
  • 757,742