TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 use gnuplot and its epslatex terminal. When I include a gnuplot-generated figure in my document and center it as usual, it often appears shifted right — because the labels on the left contribute to the LaTeX-calculated figure width:





  \caption{I am visually shifted right!}

  % Plot source:
  % set terminal epslatex color
  % set output 'myplot.tex'
  % set format '$%g$'
  % set ylabel 'A label'
  % plot 100000 * sin(x) title '$100000 \sin x$'


The result:


The question is: how does one properly align such a plot, so that the center of the plot matches the center of the page horizontally? (Inserting a matching negative horizontal space manually doesn't count. (-:)

share|improve this question
You can set the label with a package. For example: overpic, pstool. – Marco Daniel May 13 '11 at 13:52
Thanks a lot for this question ! I was going to ask exactly the same :) – Elenaher Oct 10 '12 at 9:10
up vote 5 down vote accepted

You can set the margins of the plot in gnuplot using lmargin at screen 0 and rmargin at screen 1.0, so that the plot takes up the entire canvas. The labels will still be placed correctly:

epslatex gnuplot properly centred

share|improve this answer
This is excellent! – Andrey Vihrov May 13 '11 at 21:36

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.