5

I would like to have a left-positioned loop "look the same" as a below-positioned loop emanating from a rectangular node.

\documentclass{article}
\usepackage{tikz}

\tikzstyle{rect} = [rectangle, rounded corners, minimum width=3cm, minimum       height=1cm,text centered, draw=black, fill=red!30]

 \begin{document}
 \begin{tikzpicture}
 \node (A) (r) [rect] {Rectangle};
 \path[->] (r) edge  [loop below] node {Below} ();
 \path[->] (r) edge  [loop left] node {Left} ();
 \end{tikzpicture}
 \end{document}

enter image description here

For example the left loop is fatter and bigger. I want it to start and finish in the middle of the left-vertical side of the rectangle and be of the same size/shape as the lower loop.

Thanks

Ron

Ans:

As per Harish Kumar's answer (with some minor configurations)

\begin{tikzpicture}
\node (r) [rect] {Rectangle};
\path[->] (r) edge  [loop below] node {Below} ();
\path[->] (r.185) edge  [out=195, in=170,distance=0.8cm] node[anchor=east] {Left}(r.175);
\end{tikzpicture}

enter image description here

4

Both the loops set their origin from the center of the node while calculating parameters and since the width and height of the node is different, they come out in different sizes. You may draw the loops by yourselves in such cases.

\documentclass{article}
\usepackage{tikz}

\tikzstyle{rect} = [rectangle, rounded corners, minimum width=3cm, minimum       height=1cm,text centered, draw=black, fill=red!30]

 \begin{document}
 \begin{tikzpicture}
 \node[draw,minimum size=1cm] (a){};
 \path[->] (a) edge  [loop below] node {Below} ();
 \path[->] (a) edge  [loop left] node {Left} ();
 \end{tikzpicture}
 \begin{tikzpicture}
 \node (A) (r) [rect] {Rectangle};
 \path[->] (r.300) edge  [out=300,in=240,distance=1.5cm]node[anchor=north] {Below} (r.240) ;
 \path[->] (r.190) edge  [out=190,in=170,distance=1.5cm] node[anchor=east] {Left} (r.170);
 \end{tikzpicture}
 \end{document}

enter image description here

You may have to adjust the looseness/tension to make them exactly similar.

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.