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

How can I position a node in, say, the top-left corner of the tikzpicture without setting the position explicitly?

Are there any hooks for positioning relative to the tikzpicture "frame" itself (and that will work in the general case)?

share|improve this question
up vote 7 down vote accepted

The current bounding box node is just that, a node encompassing the content of the tikzpicture at that point. Hence, current bounding box.north west is the top left corner. The bounding box may of course change if you add new elements to the diagram.

A quick example:


\fill (0,0) circle[radius=3pt];
\fill (2,3) circle[radius=3pt];

\node [draw,below right] at (current bounding box.north west) {top left};
\draw [red] (current bounding box.south east) rectangle (current bounding box.north west);

enter image description here

share|improve this answer
Great thanks! Pro-tips for anyone as dumb as me: make sure to put the node anchored on the bounding box only after the bounding box won't change: e.g., after everything else. :) – badroit Aug 14 '14 at 20:02

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.