Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Attached below is the minimum working example. I would like the arrow to end at the west anchor of the node "operation". I tried anchor and few other possibilities but they don't seem to affect the edge position.

\documentclass{article}  
\usepackage{tikz}  
\usetikzlibrary{shapes,positioning}  
\begin{document}    
\tikzstyle{data}=[circle,shade,fill=blue!60, draw]
\tikzstyle{operator}=[shape=rectangle, rounded corners, fill=cyan, draw=cyan]   

\begin{tikzpicture}
\node[data] (uncurated) {content};  
\path node[operator] (schematize) [below = of uncurated.south]{operation}
edge[<-,thick]  node[auto]{\tiny flow} (uncurated.south);  
\end{tikzpicture}  
\end{document}

output

share|improve this question
    
Please ensure that the posted code can be cut and pasted to into a document. The version you had posted had all the square brackets escaped fro some reason. –  Peter Grill Apr 16 '13 at 19:41
    
\path node[operator, below=of uncurated] (schematize) {operation} (schematize.west) edge[<-,thick] node[auto]{\tiny flow} (uncurated.south); works for me. –  Qrrbrbirlbel Apr 16 '13 at 19:44
    
Actually, this solution works better. Thanks. –  Sandeep Apr 16 '13 at 20:54

2 Answers 2

up vote 4 down vote accepted

It might be easier to just use a separate draw command and specify the in= and out= angles:

enter image description here

Code:

\documentclass{article}  
\usepackage{tikz}  
\usetikzlibrary{shapes,positioning}  
\begin{document}    
\tikzstyle{data}=[circle,shade,fill=blue!60, draw]
\tikzstyle{operator}=[shape=rectangle, rounded corners, fill=cyan, draw=cyan]   

\begin{tikzpicture}
\node[data] (uncurated) {content};  
\path node[operator] (schematize) [below = of uncurated.south]{operation}
edge[<-,thick]  node[auto]{\tiny flow} (uncurated.south);  
\path [->, thick, red] (uncurated.south) edge (schematize.west);
\end{tikzpicture}  
\begin{tikzpicture}
\node[data] (uncurated) {content};  
\path node[operator] (schematize) [below = of uncurated.south]{operation}
edge[<-,thick]  node[auto]{\tiny flow} (uncurated.south);  
\path [->, thick, blue] (uncurated.south) edge[out=-145, in=180] (schematize.west);
\end{tikzpicture}  
\end{document}
share|improve this answer
    
That works. Thanks so much. For some reason reading the manual didn't give me a hint that I could mix the draw and edge primitives. –  Sandeep Apr 16 '13 at 19:45
    
@Sandeep You shouldn't. Use \path if you use edge and not \draw. Do you see the lonely blue up-arrow at the content node? –  Qrrbrbirlbel Apr 16 '13 at 19:47
    
@Qrrbrbirlbel by lonely you mean the arrow head is dislodged from trunk of the arrow? If so, yes. Will you path and edge. –  Sandeep Apr 16 '13 at 20:18
    
@Sandeep Yes, that's caused by using \draw and edge together. The reason is a zero-length line from and to (uncurated.south). The calculated direction for such a zero-length line is 90° (atan(∞)). The edge operator creates sub-paths. –  Qrrbrbirlbel Apr 16 '13 at 20:27
    
@Qrrbrbirlbel: Thanks, I did not know that one should use \path instead of \draw with an edge. I normally don't use edge and am used to using to instead. –  Peter Grill Apr 16 '13 at 21:10

Sometimes the easiest way to achieve the good results in TikZ is to place nodes first and then draw the lines:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning}
\begin{document}
\tikzstyle{data}=[circle,shade,fill=blue!60, draw]
\tikzstyle{operator}=[shape=rectangle, rounded corners, fill=cyan, draw=cyan]
\begin{tikzpicture}
\node [data] (uncurated) {content};
\node [operator] (schematize) [below=of uncurated] {operation};
\draw [-stealth] (uncurated) -- node [auto, swap] {\tiny flow} (schematize);
\end{tikzpicture}
\begin{tikzpicture}
\node [data] (uncurated) {content};
\node [operator] (schematize) [below=of uncurated] {operation};
\draw [-stealth] (uncurated) -- node [auto, swap] {\tiny flow} (schematize.west);
\end{tikzpicture}
\end{document}

compiled code

Note that you do not have to use anchors always (e.g., below=of uncurated is the same as below=of uncurated.south and placing only node names in \draw allow TikZ to calculate the anchors automagically.

share|improve this answer

Your Answer

 
discard

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.