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

Using \includegraphics{} from graphicx, I'm including this figure in my document: alt text

Due to the long legend text, when the caption is centered underneath this, it's not centered under the graph region. Is there some way to adjust the horizontal positioning of the graphic rightwards?

share|improve this question
I've always wanted to be able to export graphics like this with their bounding box shifted so the graphs themselves were centred and the legends, axes, etc, "hung out" of the figure. Never looked into doing it though; I suspect it'd be a big pain in Matlab or Mathematica. Best way would be to export the data to PGF and plot it there, but again, I'm not aware of a prebuilt way to do it. – Will Robertson Sep 8 '10 at 1:56
up vote 2 down vote accepted

you may be able to play with the horizontal positioning through \hspace*{length} command where length has to include units like 2cm.

\begin{figure}[h] \hspace*{length}\includegraphics{} \end{figure}

but it is probably not a good idea to have a legend on the side.

share|improve this answer
Well, long skinny graphic might not be the best idea in the first place but it's just an example. Side-legend is perfectly acceptable for lots of other kinds of plots (although I try and avoid legends where possible these days). – Will Robertson Sep 8 '10 at 1:57
That did the trick. Thanks very much! – JoFrhwld Sep 8 '10 at 3:26
@Will: what do you use instead of a legend, then? Figure captions? Inline text inside the figure (next to the related data)? I’m just faced with such a situation … – Konrad Rudolph Sep 8 '10 at 15:53
Figure captions are worse than legends! I try to label the data directly on top of or next to the graph lines, but you need a bit of room and it takes much longer to design the graph. Sometimes legends are unavoidable. – Will Robertson Sep 8 '10 at 16:06
a few scientific journals ask to put the legend in the caption: is this very wrong? This way, you can save space and you do not have to hide a part of the graph with the legend – pluton Sep 8 '10 at 16:23

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.