5

I'm new to TikZ, and I can't seem to figure out how to align lines to a text box.

In the figure below, the bottom arrow is aligned exactly how I would like (from the upper right corner of box C to the bottom left corner of box I. When I create a text box that contains greater than 1 character, the arrow becomes misaligned as in the top arrow.

How can I get the beginning of the line aligned to variable sized boxes?

enter image description here

Here is my current code:

\begin{figure}

\tikzstyle{vspecies}=[rectangle, minimum size=0.5cm,draw=black,fill=white]
\begin{tikzpicture}[auto, outer sep=1pt, node distance=2cm,>=latex']

\node [vspecies] (I) {I} ;
\node [vspecies, above left of = I] (S) {SFs} ;
\node [vspecies, below left of = I] (C) {C} ;
\draw [->,thick] (S) --  node {\small{$63$}} (I) ;
\draw [->,thick] (C) --  node [below right] {\small{$733$}} (I) ;

\end{tikzpicture}

\end{figure}
8

Simply refer to .south east of the node, similar for other corners (.north west etc.).

\draw [->,thick] (S.south east) --  node {\small{$63$}} (I) ;

arrow from bottom right corner of a node

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.