I have a tikzpicture,in this case a blue rectangle, that will produce a bounding box, here visualized by the green background. I would now like to place a node in the top left corner of the bounding box. In this case, since I know the absolute coordinates it is easy to do, but that is not always the case, especially when using external graphics or drawing three dimensional objects in rotated coordinate systems. It would therefore be handy, to be able to place the nodes relative to the bounding box. In the axis environment, nodes can be placed in relative coordinates using rel axis cs. In this case the code would be \node at (rel axis cs:0,1) [anchor=north west] {node content}. Since in my example, there is no pre-defined axis,this is not possible here. Is there something similar for a plain tikzpicture?
\documentclass[10pt,crop]{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\begin{document}
\begin{tikzpicture}[tight background,background rectangle/.style=
{fill=green},show background rectangle] \path[draw=black,fill=blue]
(0,-1) -- (-1,0) -- (1,2) -- (2,1) -- cycle;
\end{tikzpicture}
\end{document}



use as bounding boxon a specific path. – nickpapior Jan 21 '13 at 14:49current bounding box.north westand after thatcurrent bounding box.south westwill not place the nodes beneath each other. – Janek Jan 21 '13 at 14:53\makeatletter \let\disablebbupdate\pgf@relevantforpicturesizefalse \let\enablebbupdate\pgf@relevantforpicturesizetrue \makeatotherand insert\disablebbupdateright before the 'me' node. – nickpapior Jan 21 '13 at 15:24nodein the upper left corner of thebounding boxwithout expanding it, the problem is solved. The only question, that remains is about more arbitrary positions of thenode. In your example you use absolute values to shift thenodes. When the size of the rectangle is changed, so will the positions of the nodes relative to the rectangle. – Janek Jan 21 '13 at 15:35overlayoption or put content insidepgfinterruptboundingboxenvironment to avoid bounding box being updated. – percusse Jan 21 '13 at 16:11