TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a bunch of LaTeX-output from Gnuplot which I would really like to leave alone. Is there an easy way of scaling an entire figure?

Something like


but just for the figure environment?

If it matters, I have


and the output is from gnuplot used "set terminal latex" and so on.

share|improve this question
up vote 33 down vote accepted

You are looking for the macros

  • \resizebox{<h-length>}{<v-length>}{<content>} and
  • \scalebox{<h-scale>}[<v-scale>]{<content>}

from the graphics/graphicx packages (→ graphics manual, 3.3 “Scaling”, p. 3).

The \scalebox macro expects ratios like those you’d use in \includegraphics, you you would be using


or, if you rather want to resize the content to a fixed width (or height),


where ! means that the content gets resized so that it keeps its aspect ratio.

There exist also a starred version of \resizebox and you can use the lengths \height, \width, \totalheight and \depth to refer to the original sizes of the content; meaning the factor .5 could be used with \resizebox, too:

share|improve this answer
Is it possible to do something like this from outside of the figure environment? – iX3 Oct 7 '13 at 18:55
\scalebox also works with .pstex_t files exported from xfig (the .pstex_t file includes --with \includegraphics-- a .pstex file). \resizebox does not work. – kavadias May 29 at 1:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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