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.

I would like to draw an edge between two nodes which lies on a clip of an circle. For small angles I was able to get some more or less realistic appearance by using bend left and bend right, but for large distances, for example to connect a node which lies at 90° with an node at 225°, this is getting ugly.

However, drawing an arc alone does not draw arrows and does not end at the "borders" of the nodes, but at their center. So is there any solution, e.g. an argument for "edge" while building a path, where I can specify an arc on which it should lie?

Here is an example:

enter image description here

\documentclass{scrartcl}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
\node (V1) at (0,8) {$\o{v}_1$};
\node (V3) at (4,4) {$\o{v}_2$};
\node (V5) at (0,0) {$\o{v}_3$};
\node (V6) at (-2.83,1.17) {$\o{v}_4$};

\node at (0,4) {$\o{C}$};

\path   (V1) edge[bend left=45] node[above right] {$\o{g}_1(x)$} (V3)
        (V5) edge[bend right=45] node[below right] {$\o{g}_2(x)$} (V3)
        (V5) edge[bend left=15] node[below] {$\o{g}_3(x)$} (V6)
        (V1) edge[bend right=70] node[above left] {$\o{g}_4(x)$} (V6);
\end{tikzpicture}
\end{document}

While the first three edges of the path look more or less as if the would lie on a circle, the fourth one makes the circle a potato.

share|improve this question
2  
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Jubobs Nov 21 '13 at 14:03
    
Okay, sorry, I added an example. –  user1742364 Nov 21 '13 at 14:34
    
Does this help? tex.stackexchange.com/questions/103663/… –  percusse Nov 21 '13 at 14:35

2 Answers 2

up vote 6 down vote accepted

you say:

drawing an arc alone does not draw arrows and does not end at the "borders" of the nodes, but at there center

(*their center, b.t.w.)

but it is not completely true; you can try with a workaround with arc. For example:

\draw [right, ->] (0.3,8) arc [radius=4, start angle=90, end angle= 0];

will draw an arrow from V1 to almost V2.

Playing around with the radius and the location of the nodes you can draw your circle (with arrows, see the -> above)

EDIT:

to avoid playing around with the starting location you can use node anchors:

\draw [->] (V1.east) arc [radius=4, start angle=90, end angle= 0];
share|improve this answer
    
Thanks, that helps. Is there an argument for draw which says "start the line after 3mm and stop 3mm before the target" ? That would avoid the use of approximate coordinates. –  user1742364 Nov 21 '13 at 15:03
    
@user1742364 there should be. I am not the ultimate expert, but someone else might help you with the use of anchors –  Federico Nov 21 '13 at 15:09
    
@user1742364 I edited my answer to use anchors as starting locations –  Federico Nov 21 '13 at 15:13
    
Brilliant - thank you! –  user1742364 Nov 21 '13 at 15:49

Another arc solution:

\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}

\begin{tikzpicture}
\node (V1) at (0,8) {$\o{v}_1$};
\node (V3) at (4,4) {$\o{v}_2$};
\node (V5) at (0,0) {$\o{v}_3$};
\node (V6) at (-2.83,1.17) {$\o{v}_4$};

\node at (0,4) {$\o{C}$};

\draw[-latex,shorten <= 10pt,shorten >= 10pt] (V1) arc(90:0:4cm) node[above right=3ex and .5ex] {$\o{g}_1(x)$} (V3);
\draw[-latex,shorten <= 10pt,shorten >= 10pt] (V5) arc(-90:0:4cm) node[below right=3ex and .5ex] {$\o{g}_2(x)$} (V3);
\draw[-latex,shorten <= 10pt,shorten >= 10pt] (V5) arc(270:225:4cm) node[below right=3ex and -2.5ex] {$\o{g}_3(x)$} (V6);
\draw[-latex,shorten <= 10pt,shorten >= 10pt]        (V1) arc(90:225:4cm) node[above left =1ex and 2.5ex] {$\o{g}_4(x)$} (V6);
\end{tikzpicture}
\end{document}

enter image description here

Adjust the start angle, end angle and shorten (both <= and >=) distances as per taste.

share|improve this answer
    
That's cool, too, didn't know that. Thank you. –  user1742364 Nov 21 '13 at 15:50

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.