[Tex/LaTex] Best practice regarding graphics size

best practicesgraphicsrresolution

Whenever I make graphs from R to be included in Latex, I find myself scuttling back and forth between R to specify the size of the output and Latex to play with the \includegraphics[scale=??].

It takes a lot of trial and error because:

  1. I don't see the change interactively. I only know whether something
    works after compiling (which adds up time annoyingly).
  2. Different R outputs, e.g. pdf, png, have different measurement units (pdf is in inch, png is in what unit? I'm not even sure). As someone who's only familiar with metric units, this adds to the confusion.
  3. When the graphics appears on Latex, it also gets changed yet another time due to the border length of the document.

Adding these three sources of unpredictability, it takes an inordinate amount of time to simply specify size. Ideally, I want to be making changes interactively only at one place instead of going back and forth.

Is there any best practice I should follow?

Best Answer

I think what you may be looking for is instead of using the scale option you should use the width option in \includegraphics.

There are different widths you can use \textwidth or \linewidth are likely what you are looking for.

\includegraphics[width=.5\textwidth]{...} will scale your graphic to be half of the text width. If your graphic is inside an environment with a different line width, like a list, then you may want to use \linewidth instead of \textwidth.

You may find it useful to take a look at Werner's answer to a similar question.