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.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node(a){test};
\node(b)[below=5cm of a]{test2};
\draw[red,bend right=90](b.east)to(a.east);
\end{tikzpicture}
\end{document}

This is a simple question, I'm searching for a way to bend the line more than 90, ideally the line should make a bigger detour. How should I do it?

Here is what I mean: Image of bending

share|improve this question

4 Answers 4

up vote 8 down vote accepted

Option 1

You could change your bend right=90 to out=-45, in=45.

enter image description here

Option 2

You could use a Bezier curve. Adjust the 5 to the value you like.

\draw[red](b.east) .. controls +(5,0) and +(5,0) .. (a.east);

enter image description here

share|improve this answer
    
no sorry, that is not what I meant. I want the line to go more far away, in your example, to go east until it reaches your avatar. –  Erika May 28 at 19:49
    
please see the attached picture –  Erika May 28 at 19:54
    
This is it, but I can't see your code, only the picture –  Erika May 28 at 20:01
    
replace \draw[red](b.east) .. controls +(5,0) and +(5,0) .. (a.east); –  Ahmad May 28 at 20:08
    
in code given above by john –  Ahmad May 28 at 20:08

You can use distance:

\draw[red](b.east)to[bend right=90,distance=7cm](a.east);

Code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node(a){test};
\node(b)[below=5cm of a]{test2};
\draw[red](b.east)to[bend right=90,distance=7cm](a.east);
\end{tikzpicture}
\end{document}

enter image description here

Or you can put the controls straight in the options of to operation.

\draw[red](b.east)to[controls=+(0:7) and +(0:7)](a.east);

Code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node(a){test};
\node(b)[below=5cm of a]{test2};
\draw[red](b.east)to[controls=+(0:7) and +(0:7)](a.east);
\end{tikzpicture}
\end{document}
share|improve this answer

Are you looking for the looseness Option?

\documentclass[margin=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
  \node(a){test};
  \node(b)[below=5cm of a]{test2};
  \draw[red,bend right=90,
    looseness=3
  ](b.east)to(a.east);
\end{tikzpicture}
\end{document}

enter image description here

Or with

\draw[red,out=-20, in=20,
  looseness=3
](b.east)to(a.east);

enter image description here

share|improve this answer

Here is another solution using your style of "nodes"- You can leave the node label empty to have only 2 nodes "visible".

You can change the tension=1.5 to your liking.

You can find more information on control points and tension in TikZ manual on Section 2.4 on page 31.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node(a){test};
\node(b)[below=5cm of a]{test2};
\node(c)[below right=3cm of a]{control node};
%\draw[red,bend right=90] (b.east) to (a.east);
\draw[red] plot [smooth, tension=1.5] coordinates {
    (b.east) (c.east) (a.east)
};

\end{tikzpicture}
\end{document}

enter image description here

Here is the example with empty node

enter image description here

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.