LaTeX forum ⇒ Graphics, Figures & TablesRemoving 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

Postby Seanshine » Sun Jul 08, 2018 5:05 pm

Dear readers,

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

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


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
(17.92 KiB) Downloaded 14 times
Last edited by Seanshine on Sun Jul 08, 2018 5:19 pm, edited 2 times in total.

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 9156
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Jul 08, 2018 5:09 pm

Hi,

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

Stefan
Site admin

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

Postby Seanshine » Sun Jul 08, 2018 5:45 pm

Done

User avatar
Stefan Kottwitz
Site Admin
Posts: 9156
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Jul 08, 2018 6:08 pm

The white space is already in the original file, see the attached PNG, just converted.

rstar_analysis.png
rstar_analysis.png (12.07 KiB) Viewed 891 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
Site admin

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

Postby Seanshine » Sun Jul 08, 2018 7:34 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?

User avatar
Stefan Kottwitz
Site Admin
Posts: 9156
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Jul 08, 2018 7:43 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
Site admin

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

Postby Seanshine » Sun Jul 08, 2018 9:59 pm

Final product:

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


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 3 guests