13

I just started using TikZ an it's amazing. But I can't find out how to change the position of the label inside a node. At the moment I've:

\node (DataAccess) at (0,2) [draw,thick,minimum width=8cm,minimum height=2cm,
      align=center, rounded corners] {Datenzugriff};

But I'd like to have the text in the upper center (but inside) of the rectangle. Any idea?

1 Answer 1

14

You can use text depth:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node (DataAccess) at (0,2) [draw,thick,minimum width=8cm,minimum height=2cm, align=center, text depth=2cm, rounded corners, label=below:User space] {Datenzugriff};\end{tikzpicture}

\end{document}

enter image description here

0

You must log in to answer this question.

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