1

I have the following code which gives the attached picture.

\documentclass[border=4mm]{standalone}
\usepackage{tkz-berge}
\begin{document}
    \begin{tikzpicture}
    [->, >=stealth', auto, thick,
    main node/.style=
    {circle, fill=black!30, draw, minimum size=.3cm, inner sep=0pt]},
    scale=2
    ]
    \newcommand\vx{0.5}
    \newcommand\vy{.5}
    \newcommand\fx{1} % 4.x
    \node[main node] (*) at (-\vx,  0 ) {$*$};

    \node[main node] (n) at ( \vx, \vy) {$n$};
    \node[main node] (m) at (\vx, -\vy) {$m$};

    \node (x_1) at (-2*\vx,-\vy) {$x_1 $};
    \node (x_mid) at (-2*\vx,0) {$... $};
    \node (x_i) at (-2*\vx,\vy) {$x_i$};
    \node (y_1) at (4*\vx,\vy) {$y_1$};
    \node (y_mid) at (4*\vx,0) {$...$};
    \node (y_j) at (4*\vx,-\vy) {$y_j$};
    \path[-]
    (*) 
    edge node {} (m) 
    edge node {} (n) 

    ;
    \begin{scope}[every path/.style={->}]
    \draw (*) --(x_1);
    \draw (*) -- (x_mid); 
    \draw (*) -- (x_i);
    \draw (*) -- (y_1);
    \draw (*) -- (y_mid); 
    \draw (*) -- (y_j);
    \end{scope}  

    \end{tikzpicture}
\end{document}

This gives:

The image of the above code

However I would like to replace the arrows on the right with something that looks like the second picture. I need the arrows to go along a similar path and then diverge. Can anyone please give me some tips? It would be great if I could include a circle like shown as well.

The result that I am looking for

  • 1
    Your title has bend which to me means curved but your image has lines going straight with a kink midway. Do you have a preference between the two cases? – Dai Bowen Dec 4 '16 at 18:57
  • By bend I meant straight lines with kinks as you say. Sorry for the confusion. – ushham Dec 4 '16 at 21:47
0

Add a new node at a useful position, e.g. 2*\vx,0, and draw the lines via that:

enter image description here

\documentclass[border=4mm]{standalone}
\usepackage{tkz-berge}
\begin{document}
    \begin{tikzpicture}
    [->, >=stealth', auto, thick,
    main node/.style=
    {circle, fill=black!30, draw, minimum size=.3cm, inner sep=0pt]},
    scale=2
    ]
    \newcommand\vx{0.5}
    \newcommand\vy{.5}
    \newcommand\fx{1} % 4.x
    \node[main node] (*) at (-\vx,  0 ) {$*$};

    \node[main node] (n) at ( \vx, \vy) {$n$};
    \node[main node] (m) at (\vx, -\vy) {$m$};

    \node (x_1) at (-2*\vx,-\vy) {$x_1 $};
    \node (x_mid) at (-2*\vx,0) {$... $};
    \node (x_i) at (-2*\vx,\vy) {$x_i$};
    \node (y_1) at (4*\vx,\vy) {$y_1$};
    \node (y_mid) at (4*\vx,0) {$...$};
    \node (y_j) at (4*\vx,-\vy) {$y_j$};
    \node [draw,circle,minimum size=6mm] (kink) at (2*\vx,0) {}; %%% <-- added
    \path[-]
    (*) 
    edge node {} (m) 
    edge node {} (n) 

    ;
    \begin{scope}[every path/.style={->}]
    \draw (*) --(x_1);
    \draw (*) -- (x_mid); 
    \draw (*) -- (x_i);
    \draw (*) -- ([yshift=1mm]kink.center) -- (y_1); %% added middle coordinate
    \draw (*) -- (y_mid); 
    \draw (*) -- ([yshift=-1mm]kink.center) -- (y_j); %% added middle coordinate
    \end{scope}  

    \end{tikzpicture}
\end{document}

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.