## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Removing excess white space around figures Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm

### Removing excess white space around figures

I am trying to fit in an .eps-formatted figure. However, there is excess white space between text and figure. Current code:

%\begin{figure}[H]\hspace*{-0.6in}\includegraphics[scale = 0.6]{Figures/rstar_analysis.eps}\vspace*{-35mm}\caption{Combined estimated paths of $r^{*}$}\end{figure} \label{fig: 5.2}%

I've also tried to use minipage, which was slightly better, but I did not really understand its use in this setting; and wrapfigure, which does not work with my current template settings.

I've been trying to figure this out for a long time, solutions appreciated!

PS. eps-file in the attachment.
rstar_analysis.eps
Last edited by Seanshine on Sun Jul 08, 2018 5:19 pm, edited 2 times in total.

Tags:

Stefan Kottwitz
Posts: 9019
Joined: Mon Mar 10, 2008 9:44 pm
Hi,

can you please post the .eps figure here, as attachment?

Stefan

Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm
Done

Stefan Kottwitz
Posts: 9019
Joined: Mon Mar 10, 2008 9:44 pm
The white space is already in the original file, see the attached PNG, just converted.

rstar_analysis.png (12.07 KiB) Viewed 460 times

Just cut the white space with a graphics editor, or better: generate the PS file without that white space in the original software. Or use \includegraphics with options such as trim.

Stefan

Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm
Apparently within the original software (R), it is not so easily achieved. Vector formatted files need specific software for editing, and is therefore not that straight forward. Would trim be an option? How does it work?

Stefan Kottwitz
Posts: 9019
Joined: Mon Mar 10, 2008 9:44 pm
It's explained in the graphicx manual, section 4.4 Including Graphics Files, have a look. Let me know (with code) if you try and it doesn't work.

Stefan

Seanshine
Posts: 52
Joined: Sat Apr 28, 2018 9:59 pm
Final product:

%\begin{figure}[H]\centering\hspace*{-0.5in}\includegraphics[width=7in, height=2.8in, trim = {0 1.6cm 0 1.5cm}, clip]{Figures/rstar_analysis.eps}\vspace*{-3mm}\caption{Combined estimated paths of $r^{*}$}\end{figure} \label{fig: 6.1}%