8

I'm trying to draw graphs and especially quivers, for instance the quiver made of one vertice and one loop upon it. A simple way please ? (PS. not sure about the tag)

Edit : To be clear a quiver is nothing but a directed graph where loops and multiple arrows between vertices are allowed. No link with graphs of functions!

Edit : ok so to be clear here are pictures :

a quiver

a quiver where every arrow is given a name

a loop

So you see there are vertices, arrows between those vertices and both vertices and arrows are given a name by a letter upon them. And you can have an arrow that starts and ends at the same vertice (but this case is not so important, it's ok if it's not doable).

7
  • 1
    Welcome to TeX.SX! Please clarify your question, or you might get a drawing of a container for arrows and a drawing of what you really want in addition to the drawing of a quiver plot which has already been posted. :-) Mar 13, 2015 at 20:44
  • 2
    Still not clear to me... maybe a picture of an actual graph could be helpful. :)
    – Pier Paolo
    Mar 13, 2015 at 20:50
  • 4
    quiver is for the rest of the nonmathematician world is a flow diagram showing any field vector as in meteorology, fluid dynamics etc. unfortunately graph theory is the esoteric one not the other way around.
    – percusse
    Mar 13, 2015 at 21:10
  • 3
    You mean.... There is a nonmathematician world ??
    – krirkrirk
    Mar 13, 2015 at 21:13
  • 2
    Yes, we were afraid that this confrontation day would come
    – percusse
    Mar 14, 2015 at 9:12

2 Answers 2

10

Here are some examples reproducing those in some notes about representations of algebras

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}

Example 3
\[
\begin{tikzcd}
1 \arrow[r,"\alpha"] & 2
\end{tikzcd}
\]

Example 4
\[
\begin{tikzcd}
1 \arrow[r] & 2 \arrow[r] & \cdots \arrow[r] & n
\end{tikzcd}
\]

Example 5
\[
\begin{tikzcd}
& 2 \arrow[d] \\
1 \arrow[r] & 5 & 3 \arrow[l] \\
& 4 \arrow[u]
\end{tikzcd}
\]

Example 6
\[
\begin{tikzcd}
1 \arrow[out=0,in=90,loop]
\end{tikzcd}
\]

Example 7
\[
\begin{tikzcd}
1 \arrow[out=0,in=30,loop,swap,"\alpha_1"]
  \arrow[out=90,in=120,loop,swap,"\alpha_2"]
  \arrow[out=180,in=210,loop,swap,"\cdots"]
  \arrow[out=270,in=300,loop,swap,"\alpha_n"]
\end{tikzcd}
\]

Example 8
\[
\begin{tikzcd}
1 \arrow[r,bend left,"\alpha"] \arrow[r,bend right,swap,"\beta"] & 2
\end{tikzcd}
\]

\end{document}

enter image description here

And two of your examples

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}
\[
\begin{tikzcd}[arrow style=tikz,>=stealth,row sep=4em]
1 \arrow[rr,"\gamma_{13}"]
  \arrow[dr,shift left=.4ex]
  \arrow[dr,shift right=.4ex,swap,"\gamma_{12}"]
&& 2 \\
& 3 \arrow[ur,shift left=.4ex]
  \arrow[ur,shift left=1.2ex]
  \arrow[ur,shift right=.4ex]
  \arrow[ur,shift right=1.2ex,swap,"\gamma_{23}"]
\end{tikzcd}
\]

\[
\begin{tikzcd}
1 \arrow[drr,shift right=.2ex,swap,"\beta_1"] &
2 \arrow[dr,"\beta_2"] &&
3 \arrow[dl,swap,"\beta_3"] &
4 \arrow[dll,shift left=.2ex,"\beta_4"] \\
&& 5
\end{tikzcd}
\]
\end{document}

enter image description here

2
  • This is absolutely perfect. Although the code is pretty clear, can you give some basic documentation ?
    – krirkrirk
    Mar 13, 2015 at 21:43
  • @krirkrirk The documentation of tikz-cd is quite extensive; do texdoc tikz-cd from a terminal or look for it at texdoc.net (type tikz-cd in the search box).
    – egreg
    Mar 13, 2015 at 21:46
4

Something like that, made with pstricks?

\documentclass[pdf]{article}
\usepackage{pstricks-add}

\begin{document}

\[ \psset{ArrowInside=->, ArrowInsidePos=0.25, arrowinset=0.25 , linewidth=0.6pt, nodesep=-1.5pt, colsep=1.2cm, offset =1ex}
\begin{psmatrix}[mnode = circle]
N & P
%%%
 \ncline{1,1}{1,2}\ncline{1,2}{1,1}\nccircle[angleA=90,nodesep=0pt]{->}{1,1}{.5cm}
\end{psmatrix}
\]
\end{document} 

enter image description here

\documentclass[pdf, x11names]{article}
\usepackage{boondox-ds}
\usepackage{pstricks-add}

\begin{document}

$ \psset{arrows=->, arrowinset=0 ,nodesep=3pt, labelsep=2pt, colsep=1.4cm, radius = 0.15, linewidth=0.3pt, fillstyle=solid, shortput=nab}
\begin{psmatrix}
    \Cnode[fillcolor=green](0,0){N} & & \Cnode[fillcolor=DeepSkyBlue3, \linewidth=0.3pt](0,0){P} \\
    & \Cnode[fillcolor=IndianRed3](0,0){R} \\
    %%
    \psset{ linewidth=0.8pt}
    \ncline{N}{P}^{\gamma_{13}}
    \nput{135}{N}{\mathbbb C^{d_1}}
    \nput{45}{P}{\mathbbb C^{d_3}}
    \nput[labelsep=4pt]{-90}{R}{\mathbbb C^{d_2}}
    \ncline[offset = 1.5pt]{N}{R}\ncline[offset=-1.5pt]{N}{R}\nbput{\gamma_{1,3}}
    \ncline[offset = 1.5pt]{R}{P}\ncline[offset=-1.5pt]{R}{P}
    \ncline[offset = 4.5pt]{R}{P}\ncline[offset=-4.5pt]{R}{P}\nbput{\gamma_{2,3}}
\end{psmatrix}
 $

\end{document} 

enter image description here

And a last one, as close as possible to your image:

\documentclass[pdf, x11names]{article}
\usepackage{garamondx}
\usepackage{pstricks-add}

\begin{document}

 \psset{arrows=->, arrowinset=0,nodesep=-1pt, labelsep=2pt, colsep=1.4cm, radius = 0.2, fillstyle=solid, shortput=nab}
\begin{pspicture}
    \pnode(0,0){P}
    \Cnode[linecolor =white](0,0){N}
    {\psset{doubleline, doublesep=2.5\pslinewidth, linecolor=DodgerBlue4, doublecolor=Gold4!75, angleA=180}
    \nccircle[doubleline, linecolor=DodgerBlue4, angleA=180]{-}{N}{0.7}
    \nccircle[doubleline, linecolor=DodgerBlue4, angleA=180, arrowscale =0.8 0.3]{->}{N}{0.7}}
    \nbput{\boldmath\color{IndianRed3}\itshape\bfseries x}
    \pscircle[fillcolor=DodgerBlue4!70, linecolor=red](P){0.2}
\end{pspicture}

\end{document} 

enter image description here

2
  • This looks perfect ! Any explanation on how to do this ? Or a reference?
    – krirkrirk
    Mar 13, 2015 at 21:12
  • In a moment, I'll complete with another example and explanations. You can take a look at the documentation of pst-node. Roughly, I put nodes of various sorts in a matrix of nodes, then make node connections (\nc…).
    – Bernard
    Mar 13, 2015 at 21:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .