0

I would like to draw a graph like this, with "arrow labels" (the blue edges and e_1, e_2, and e_3 labels) on top of the arrows: enter image description here I can always just use coordinate to hack it, but I'm wondering if there are easier methods.

gouhaha
  • 79
  • This post could be helpful: https://tex.stackexchange.com/questions/359594/parallel-arrows-between-nodes-of-varying-size – Juan Castaño Sep 05 '21 at 06:44

1 Answers1

5

enter image description here

\documentclass[tikz,border=10pt]{standalone}

\usepackage{tikz} \usetikzlibrary{decorations} \pgfdeclaredecoration{simple line}{initial}{%<------https://tex.stackexchange.com/a/216086/197451 \state{initial}[width=\pgfdecoratedpathlength-1sp]{\pgfmoveto{\pgfpointorigin}} \state{final}{\pgflineto{\pgfpointorigin}} } \tikzset{ shift left/.style={decorate,decoration={simple line,raise=#1}}, shift right/.style={decorate,decoration={simple line,raise=-1*#1}}, } \begin{document}

\begin{tikzpicture}[] \tikzstyle{every node} = [circle, fill=red!30] \node (a) at (0, 0) {A}; \node (b) at +(0: 5) {B}; \node (c) at +(60: 5) {C}; \foreach \from / \to in {a/b, b/c, c/a} \draw [->] (\from) -- (\to);

    \path[-&gt;,blue] (a) edge[shift left=4pt, shorten &gt;=3em, shorten &lt;= 3em] node[fill=none, above]{$e_2$}(b);

\path[->,orange] (b) edge[shift left=4pt, shorten >=3em, shorten <= 3em] node[fill=none, below]{$e_2$}(a); \end{tikzpicture}

\end{document}

js bibra
  • 21,280