0

This question already has an answer here:

I used the Tikz to draw a directed graph. But the problem is the orientations are the end of edges. I need something like the following picture:

enter image description here

But my graph is in the following picture.

enter image description here

marked as duplicate by Ruben, Mico, Heiko Oberdiek, Paul Gaborit tikz-pgf Aug 5 '15 at 11:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

There are lots of ways, for example:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}

\begin{document}
\begin{tikzpicture}
  \foreach \a/\pos [count=\i] in {%
    0/20,
    -45/-25,
    -90/-70,
    -135/-115,
    135/115} {
    \draw[thick, -{Circle[open]}] (0, 0) -- (\a:20mm);
    \node at (\pos:10mm) {$I_{\i}$};
  }
  \foreach \a/\direction in {0/<, -45/>, -90/<, -135/>, 135/<} {
    \draw[thick, >={Stealth},-\direction] (0, 0) -- (\a:11mm);
  }
  \node[at=(current bounding box.south), below=2ex, inner sep=0pt]
    {$I_1 - I_2 + I_3 - I_4 + I_5 = 0$};
\end{tikzpicture}
\end{document}

Result

0

There should be a direct way of drawning it, but you can draw 2 paths :

\begin{tikzpicture}[thick]
 \draw (0,0) -- (1,0);
 \draw[<-] (1,0) node[above]{$I_1$} -- (2,0);
\end{tikzpicture}

Otherelse, you can use the [midway] option who write the node in the middle of the path.

Not the answer you're looking for? Browse other questions tagged or ask your own question.