I have three tikz/pgf pictures which I want to overlay using something like that

\draw [yshift=5cm](0,0) rectangle (5,5);

but that doesn't work, since it draws the three pictures, one after another (even the yshift has no effect). How can I do that?

  • Did you try putting only the draw commands in the files and inputing them in the same TikZ-picture? Like \begin{tikzpicture} \draw...; \input{} }input{} \input{figures/hahn_long.pgf}? Commented Nov 11, 2013 at 14:52
  • yeah, not really, because the two .pgf pictures are created with python-matplotlib, and are therefore quite complicated, and not just simple \draw... commands...
    – wa4557
    Commented Nov 11, 2013 at 15:04

1 Answer 1


Without a minimal working example (MWE) it is a bit difficult to know what exactly shall be achieved here. However, if your goal is to horizontally overprint the context of your three figures, this can be achieved either using low-level TeX commands (\llap{<content>}, \rlap{<content>}) or, a bit more generic and less error-prone, LaTeX's \makebox[<width>][<align>]{<content>} command, with a zero value for the <width> parameter.

This TUBboat article provides a bit of background on these (and more) commands. In the following, I will use \makebox; in the last example additionally \raisebox{<yshift>}{<content>} to implement a vertical shift:



    Text starts here:



    Text ends here:



      Centered, y-shifted:


      And so on...


Lacking the real figures, I have substituted the tree figures by colored squares of different size. The output looks like following:

enter image description here


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .