5

I have been trying to draw a quiver diagram using TikZ. I have made some progress, so far, but I am struggling to understand the following:

  1. How can I draw lines from nodes to nowhere that continue as dots?
  2. How can I insert some dots in between lines?

I am attaching a sketch by hand and what I have done so far. Essentially, I have some problems creating the lines to the right part of the quiver.

What I would like to achieve is the following:

result

What I have is this:

sofar

The code

\documentclass[12pt]{article}
\pdfoutput=1
\usepackage{float}
\usepackage{tikz, pgfplots}
\usetikzlibrary{arrows.meta, calc, positioning}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
\begin{figure}[H]
\begin{center}
\begin{tikzpicture}
[
node distance = 17mm and 31mm,
b/.style={rectangle, draw=black!60, fill=gray!15, very thick, minimum size=35},
c/.style={circle, draw=black!60, fill=gray!15, very thick, minimum size=35}
]

%Nodes
\node[b]      (posFk)                               {$F_k$};
\node[c]      (posak)      [below=of posFk]         {$\alpha_k$};
\node[c]      (posmuk)     [below=of posak]         {$\mu_k$};
\node[b]      (posFtk)     [below=of posmuk]      {$\tilde{F}_k$};

\node[b]      (posFF)      [left=of posFk]          {$F_2$};
\node[c]      (posakk)     [below=of posFF]         {$\alpha_2$};
\node[c]      (posmukk)    [below=of posakk]      {$\mu_2$};
\node[b]      (posFtkk)    [below=of posmukk]     {$\tilde{F}_2$};

\node[b]      (posFFF)     [left=of posFF]          {$F_1$};
\node[c]      (posakkk)    [below=of posFFF]        {$\alpha_1$};
\node[c]      (posmukkk)   [below=of posakkk]     {$\mu_1$};
\node[b]      (posFtkkk)   [below=of posmukkk]    {$\tilde{F}_1$};

%Curved lines for the quiver
\draw[-, very thick] (posmuk.east)  .. controls  +(right:17mm) and +(right:17mm)    .. (posFk.east);
\draw[-, very thick] (posak.west)       .. controls  +(left:17mm) and +(left:17mm)          .. (posFtk.west);
\draw[-, very thick] (posmukk.east)     .. controls  +(right:17mm) and +(right:17mm)    .. (posFF.east);
\draw[-, very thick] (posakk.west)  .. controls  +(left:17mm) and +(left:17mm)          .. (posFtkk.west);
\draw[-, very thick] (posmukkk.east)    .. controls  +(right:17mm) and +(right:17mm)    .. (posFFF.east);
\draw[-, very thick] (posakkk.west)     .. controls  +(left:17mm) and +(left:17mm)          .. (posFtkkk.west);

%Lines for each column of the quivers
%Right
\draw[-, very thick, dashed] (posFk.south)                                                          to node[right] {} (posak.north);
\draw[-, very thick, decorate,decoration={coil,aspect=0,segment length=5.9mm}] (posak.south)    to node[right] {} (posmuk.north);
\draw[-, very thick, dashed] (posmuk.south)                                                         to node[right] {} (posFtk.north);

%Middle
\draw[-, very thick, dashed] (posFF.south)                                                          to node[right] {} (posakk.north);
\draw[-, very thick, decorate,decoration={coil,aspect=0,segment length=5.9mm}] (posakk.south)   to node[right] {} (posmukk.north);
\draw[-, very thick, dashed] (posmukk.south)                                                    to node[right] {} (posFtkk.north);

%Left
\draw[-, very thick, dashed] (posFFF.south)                                                         to node[right] {} (posakkk.north);
\draw[-, very thick, decorate,decoration={coil,aspect=0,segment length=5.9mm}] (posakkk.south)  to node[right] {} (posmukkk.north);
\draw[-, very thick, dashed] (posmukkk.south)                                                   to node[right] {} (posFtkkk.north);

%Horizontal lines connecting the quiver
\draw[-, very thick] (posakkk.east)     to node[right] {} (posakk.west);
\draw[-, very thick] (posmukkk.east)  to node[right] {} (posmukk.west);
\draw[-, very thick] (posakk.east)      to node[right] {} (posak.west);
\draw[-, very thick] (posmukk.east)     to node[right] {} (posmuk.west);

%Diagonal lines connecting the quiver
\draw[-, very thick, dashed] (posakkk.east)     to node[right] {} (posmukk.west);
\draw[-, very thick, dashed] (posmukkk.east)  to node[right] {} (posakk.west);

\end{tikzpicture}
\end{center}
\end{figure}
\end{document}
10
  • 1
    Welcome to TeX.SX! Maybe of some help: tex.stackexchange.com/q/639726/47927 Dec 7, 2022 at 9:49
  • 1
    I would just add some coordinates between the nodes and then instead of drawing a line between two nodes, draw a lines from/to/between these coordinates. You already load the calc library that is helpful in this regard: For example, ($(posakk)!0.5!(posakkk)$) is the coordinate that sits exactly halfway between posakk and posakkk. Dec 7, 2022 at 9:55
  • 1
    What are the rules for the dotted part? How many dots? How long is the segment? Is it an absolute length or should it be a relative one. Do you also need it on curved paths? Here are some ideas. Though, the most upvoted answer isn't the best, in my opinion. Dec 7, 2022 at 10:14
  • 1
    Have you taken a look at TikZ-CD? It can make drawing this kind of diagrams much easier. Dec 7, 2022 at 10:15
  • 1
    I have defined a custom trail off dash pattern in another answer. Similar things can be done with dots, you just need to sync up the length of the line with the dash pattern. That can be done manually as in my link or somewhat automatically, see my previous link. Dec 7, 2022 at 10:23

4 Answers 4

8

Since you already load the calc library, you can make use of the syntax provided by it which allows you calculate coordinates relative to two existing coordinates.

As has already been suggested by the other answer, the syntax ($(nodeA)!0.5!(nodeB)$) means "set the coordinate halfways (50%) between nodeA and nodeB. So, 0.5 here means 50% of the distance between the two coordinates.

What is nice with this syntax is that you can even place coordinates that are not between the two coordinates using numbers smaller than 0 or larger than 1.

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, positioning, decorations.pathmorphing}

\begin{document}
\begin{tikzpicture}
[
node distance = 17mm and 31mm,
b/.style={rectangle, draw=black!60, fill=gray!15, very thick, minimum size=35},
c/.style={circle, draw=black!60, fill=gray!15, very thick, minimum size=35}
]

%Nodes
\node[b] (posFk) {$F_k$};
\node[c] (posak) [below=of posFk] {$\alpha_k$};
\node[c] (posmuk) [below=of posak] {$\mu_k$};
\node[b] (posFtk) [below=of posmuk] {$\tilde{F}_k$};

\node[b] (posFF) [left=of posFk] {$F_2$};
\node[c] (posakk) [below=of posFF] {$\alpha_2$};
\node[c] (posmukk) [below=of posakk] {$\mu_2$};
\node[b] (posFtkk) [below=of posmukk] {$\tilde{F}_2$};

\node[b] (posFFF) [left=of posFF] {$F_1$};
\node[c] (posakkk) [below=of posFFF] {$\alpha_1$};
\node[c] (posmukkk) [below=of posakkk] {$\mu_1$};
\node[b] (posFtkkk) [below=of posmukkk] {$\tilde{F}_1$};

%Curved lines for the quiver
\draw[-, very thick] (posmuk.east) 
    .. controls +(right:17mm) and +(right:17mm) 
    .. (posFk.east);
\draw[-, very thick] (posak.west) 
    .. controls +(left:17mm) and +(left:17mm) 
    .. (posFtk.west);
\draw[-, very thick] (posmukk.east) 
    .. controls +(right:17mm) and +(right:17mm) 
    .. (posFF.east);
\draw[-, very thick] (posakk.west) 
    .. controls +(left:17mm) and +(left:17mm) 
    .. (posFtkk.west);
\draw[-, very thick] (posmukkk.east) 
    .. controls +(right:17mm) and +(right:17mm) 
    .. (posFFF.east);
\draw[-, very thick] (posakkk.west) 
    .. controls +(left:17mm) and +(left:17mm) 
    .. (posFtkkk.west);

%Lines for each column of the quivers
%Right
\draw[-, very thick, dashed] (posFk.south) 
    to node[right] {} (posak.north);
\draw[-, very thick, decorate,decoration={coil,aspect=0,segment length=5.9mm}] (posak.south) 
    to node[right] {} (posmuk.north);
\draw[-, very thick, dashed] (posmuk.south) 
    to node[right] {} (posFtk.north);

%Middle
\draw[-, very thick, dashed] (posFF.south) 
    to node[right] {} (posakk.north);
\draw[-, very thick, decorate,decoration={coil,aspect=0,segment length=5.9mm}] (posakk.south) 
    to node[right] {} (posmukk.north);
\draw[-, very thick, dashed] (posmukk.south) 
    to node[right] {} (posFtkk.north);

%Left
\draw[-, very thick, dashed] (posFFF.south)
    to node[right] {} (posakkk.north);
\draw[-, very thick, decorate,decoration={coil,aspect=0,segment length=5.9mm}] (posakkk.south) 
    to node[right] {} (posmukkk.north);
\draw[-, very thick, dashed] (posmukkk.south) 
    to node[right] {} (posFtkkk.north);

%Horizontal lines connecting the quiver
\draw[-, very thick] (posakkk.east) to node[right] {} (posakk.west);
\draw[-, very thick] (posmukkk.east) to node[right] {} (posmukk.west);
%\draw[-, very thick] (posakk.east) to node[right] {} (posak.west);
%\draw[-, very thick] (posmukk.east) to node[right] {} (posmuk.west);

\draw[-, very thick, blue] (posakk.east) -- ($(posakk)!0.33!(posak)$);
\draw[-, very thick, dashed, blue] ($(posakk)!0.33!(posak)$) -- ($(posakk)!0.67!(posak)$);
\draw[-, very thick, blue] ($(posakk)!0.67!(posak)$) -- (posak.west);

\draw[-, very thick, blue] (posmukk.east) -- ($(posmukk)!0.33!(posmuk)$);
\draw[-, very thick, dashed, blue] ($(posmukk)!0.33!(posmuk)$) -- ($(posmukk)!0.67!(posmuk)$);
\draw[-, very thick, blue] ($(posmukk)!0.67!(posmuk)$) -- (posmuk.west);

\draw[-, very thick, blue] (posak.east) -- ($(posakk)!1.33!(posak)$);
\draw[-, very thick, dashed, blue] ($(posakk)!1.33!(posak)$) -- ($(posakk)!1.67!(posak)$);

\draw[-, very thick, blue] (posmuk.east) -- ($(posmukk)!1.33!(posmuk)$);
\draw[-, very thick, dashed, blue] ($(posmukk)!1.33!(posmuk)$) -- ($(posmukk)!1.67!(posmuk)$);

%Diagonal lines connecting the quiver
\draw[-, very thick, dashed] (posakkk.east) to node[right] {} (posmukk.west);
\draw[-, very thick, dashed] (posmukkk.east) to node[right] {} (posakk.west);

\end{tikzpicture}
\end{document}

enter image description here


Also, maybe the -| and |- operators can be helpful:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, positioning, decorations.pathmorphing}

\begin{document}
\begin{tikzpicture}
[
node distance = 17mm and 31mm,
b/.style={rectangle, draw=black!60, fill=gray!15, very thick, minimum size=35},
c/.style={circle, draw=black!60, fill=gray!15, very thick, minimum size=35}
]

%Nodes
\node[b] (posFk) {$F_k$};
\node[c] (posak) [below=of posFk] {$\alpha_k$};
\node[c] (posmuk) [below=of posak] {$\mu_k$};
\node[b] (posFtk) [below=of posmuk] {$\tilde{F}_k$};

\node[b] (posFF) [left=of posFk] {$F_2$};
\node[c] (posakk) [below=of posFF] {$\alpha_2$};
\node[c] (posmukk) [below=of posakk] {$\mu_2$};
\node[b] (posFtkk) [below=of posmukk] {$\tilde{F}_2$};

\node[b] (posFFF) [left=of posFF] {$F_1$};
\node[c] (posakkk) [below=of posFFF] {$\alpha_1$};
\node[c] (posmukkk) [below=of posakkk] {$\mu_1$};
\node[b] (posFtkkk) [below=of posmukkk] {$\tilde{F}_1$};

%Curved lines for the quiver
\draw[-, very thick] (posmuk.east) 
    .. controls +(right:17mm) and +(right:17mm) 
    .. (posFk.east);
\draw[-, very thick] (posak.west) 
    .. controls +(left:17mm) and +(left:17mm) 
    .. (posFtk.west);
\draw[-, very thick] (posmukk.east) 
    .. controls +(right:17mm) and +(right:17mm) 
    .. (posFF.east);
\draw[-, very thick] (posakk.west) 
    .. controls +(left:17mm) and +(left:17mm) 
    .. (posFtkk.west);
\draw[-, very thick] (posmukkk.east) 
    .. controls +(right:17mm) and +(right:17mm) 
    .. (posFFF.east);
\draw[-, very thick] (posakkk.west) 
    .. controls +(left:17mm) and +(left:17mm) 
    .. (posFtkkk.west);

%Lines for each column of the quivers
%Right
\draw[-, very thick, dashed] (posFk.south) 
    to node[right] {} (posak.north);
\draw[-, very thick, decorate,decoration={coil,aspect=0,segment length=5.9mm}] (posak.south) 
    to node[right] {} (posmuk.north);
\draw[-, very thick, dashed] (posmuk.south) 
    to node[right] {} (posFtk.north);

%Middle
\draw[-, very thick, dashed] (posFF.south) 
    to node[right] {} (posakk.north);
\draw[-, very thick, decorate,decoration={coil,aspect=0,segment length=5.9mm}] (posakk.south) 
    to node[right] {} (posmukk.north);
\draw[-, very thick, dashed] (posmukk.south) 
    to node[right] {} (posFtkk.north);

%Left
\draw[-, very thick, dashed] (posFFF.south)
    to node[right] {} (posakkk.north);
\draw[-, very thick, decorate,decoration={coil,aspect=0,segment length=5.9mm}] (posakkk.south) 
    to node[right] {} (posmukkk.north);
\draw[-, very thick, dashed] (posmukkk.south) 
    to node[right] {} (posFtkkk.north);

%Horizontal lines connecting the quiver
\draw[-, very thick] (posakkk.east) to node[right] {} (posakk.west);
\draw[-, very thick] (posmukkk.east) to node[right] {} (posmukk.west);
%\draw[-, very thick] (posakk.east) to node[right] {} (posak.west);
%\draw[-, very thick] (posmukk.east) to node[right] {} (posmuk.west);

\draw[-, very thick, blue] (posakk.east) -- ($(posakk)!0.4!(posak)$);
\node[blue] at ($(posakk)!0.5!(posak)$) {$\ldots$};
\draw[-, very thick, blue] ($(posakk)!0.6!(posak)$) -- (posak.west);

\draw[-, very thick, blue] (posmukk.east) -- ($(posmukk)!0.4!(posmuk)$);
\node[blue] at ($(posmukk)!0.5!(posmuk)$) {$\ldots$};
\draw[-, very thick, blue] ($(posmukk)!0.6!(posmuk)$) -- (posmuk.west);

\draw[-, very thick, blue] (posak.east) -- ($(posakk)!1.4!(posak)$);
\node[blue] at ($(posakk)!1.5!(posak)$) {$\ldots$};

\draw[-, very thick, blue] (posmuk.east) -- ($(posmukk)!1.4!(posmuk)$);
\node[blue] at ($(posmukk)!1.5!(posmuk)$) {$\ldots$};

%Diagonal lines connecting the quiver
\draw[-, very thick, dashed] (posakkk.east) to node[right] {} (posmukk.west);
\draw[-, very thick, dashed] (posmukkk.east) to node[right] {} (posakk.west);

\coordinate (helperA) at ($(posakk)!0.5!(posmukk)$);
\coordinate (helperB) at ($(posakk)!0.4!(posak)$);
\coordinate (helperC) at ($(posakk)!0.6!(posak)$);

\node[blue] at ($(posakk)!0.5!(posmuk)$) {$\ldots$};

\draw[-, very thick, dashed, blue] (posakk.east) -- (helperA -| helperB) -- (posmukk.east);
\draw[-, very thick, dashed, blue] (posak.west) -- (helperA -| helperC) -- (posmuk.west);

\coordinate (helperD) at ($(posak)!0.5!(posmuk)$);
\coordinate (helperE) at ($(posakk)!1.4!(posak)$);
\coordinate (helperF) at ($(posakk)!1.5!(posak)$);

\node[blue] at (helperD -| helperF) {$\ldots$};

\draw[-, very thick, dashed, blue] (posak.east) -- (helperD -| helperE) -- (posmuk.east);

\end{tikzpicture}
\end{document}

enter image description here

3
  • (+1) many thanks for taking the time to write this down. It's a beautiful answer. Following the comments I managed to do it myself eventually, but still your approach is far superior compared to mine!!!
    – bmf
    Dec 7, 2022 at 12:46
  • 1
    @bmf You're welcome. In the second part of the answer, I used vertical dots since I thought that this is probably the best way to show that things continue, similar to matrices. Dec 7, 2022 at 12:58
  • Yes, I spotted that. Wonderful stuff indeed!!!
    – bmf
    Dec 7, 2022 at 13:24
7

I took the liberty to reorganize your diagram into a TikZ-CD.

It might not be a commutative diagram but it is a bunch of nodes aligned in a grid like matter (i.e. a \matrix) with just a few lines between them.

Granted, this doesn't immediatly solve your dots issue but it is much easier to implement now.

There are actually two and a half approaches here:

  1. middle dotted line taken from my comment on a related Q&A which just interrupts a line and places another line (as an edge) in the space of the interruption with a special dash pattern. The values .45 and .55 are guesstimates. We could rewrite this style a bit so that it takes a fixed distance from the middle.

  2. node on line combined with a pic that is just a dotted line with a special named node around it so that it is usable as a node in node on line but also can be referenced later under a proper name.

  3. A customized dash pattern setup for the trail off solution.


You could also use an extra column and extra row (with smaller row and column seperations and just draw a dotted line there. (The math-mode dots \cdots need manual vertical adjustment to be properly used.)

Code

\documentclass[tikz]{standalone}
\usepackage{tikz-cd}
\usetikzlibrary{arrows.meta, calc, positioning}
\usetikzlibrary{decorations.pathmorphing}
\makeatletter
\tikzset{
  pic/.code=\tikz@node@is@pictrue,% https://tex.stackexchange.com/a/667155/16595
  @node on line/.style 2 args={   % https://tex.stackexchange.com/a/667341/16595
    to path={
      \pgfextra{%
        \edef\tikz@temp{% rescuing nodes and target for edge
          edge[
            line to, path only, % line to = --, path only = no draw, no fill, …
            every edge quotes/.append style={auto=false},% node *on* the line
            nodes={alias=@nodeonline@}]
          \unexpanded\expandafter{\tikz@tonodes}(\tikztotarget)
        }\expandafter}\tikz@temp
      -- (@nodeonline@#1)(@nodeonline@#2) -- (\tikztotarget)}},
  node on line/.style={@node on line={}{}},
  node on line'/.style args={#1 and #2}{@node on line={.#1}{.#2}}}
\makeatother
\tikzset{% https://tex.stackexchange.com/a/660100/16595
  rows/.style 2 args={/utils/tempa/.style={
    /tikz/row ##1/.append style={#2}},/utils/tempa/.list={#1}},
  rows*/.style 2 args={rows={#1}{nodes={#2}}},
  dotted/.pic={
    \path[name prefix ..]node[anchor=center, path only, inner sep=+0pt,
      outer sep=+0pt, minimum width=+5mm, minimum height=+\the\pgflinewidth]
        (#1){};
    \draw[line cap=round, dash expand off,
      dash pattern/.expanded=on 0pt off \the\dimexpr2\pgflinewidth\relax
    ] (left:2.5mm) -- (right:2.5mm);},
  middle dotted line/.style args={#1 and #2}{
    to path={% https://tex.stackexchange.com/questions/639726/how-to-draw-parts-of-a-line-dotted-with-tikz/659674#comment1641423_639809
      --($(\tikztostart)!#1!(\tikztotarget)$) coordinate(@s)
        ($(\tikztostart)!#2!(\tikztotarget)$) coordinate(@e)
      --(\tikztotarget) (@s)edge[line to, line cap=round,
        dash pattern/.expanded=on 0pt off \the\dimexpr2\pgflinewidth\relax,
        dash expand off](@e)}},
  mdl/.style={middle dotted line=.45 and .55},
  coily/.style={
    decorate, line join=round, decoration={
      coil, aspect=0, pre length=1mm, pre=lineto, segment length=5.9mm}}}
\tikzcdset{
  curve right/.style={start anchor=east, end anchor=east,
    out control=+(right:17mm), in control=+(right:17mm)},
  curve left/.style={start anchor=west, end anchor=west,
    out control=+(left:17mm), in control=+(left:17mm)},
  trail off main/.style 2 args={
    /tikz/arrows=-, line cap=round, start anchor={#1},
    /tikz/dash pattern/.expanded=on \the\dimexpr\pgfmatrixcolumnsep/2\relax
                                 off \the\dimexpr2\pgflinewidth\relax
                                 on 0pt off \the\dimexpr2\pgflinewidth\relax
                                 on 0pt off \the\dimexpr2\pgflinewidth\relax
                                 on 0pt off \the\dimexpr2\pgflinewidth\relax
                                 on 0pt off \the\dimexpr2\pgflinewidth\relax,
    to path={-- ++ (#2:.5*\pgfmatrixcolumnsep+10\pgflinewidth)\tikztonodes}},
  trail off/.default=right, trail off/.is choice,
  trail off/right/.style={trail off main={east}{right}},
  trail off/left/.style={trail off main={west}{left}}}
\begin{document}
\begin{tikzcd}[
  /tikz/b/.style={
    rectangle, draw=black!60, fill=gray!15, very thick, minimum size=35},
  /tikz/c/.style={
    circle, draw=black!60, fill=gray!15, very thick, minimum size=35},
  rows*={1,4}{b}, rows*={2,3}{c},
  row sep=17mm, column sep=31mm, arrows={very thick, -},
]
   F_1 \arrow[d, densely dashed] \arrow[dd, curve right]
 & F_2 \arrow[d, densely dashed] \arrow[dd, curve right]
 & F_k \arrow[d, densely dashed] \arrow[dd, curve right]
\\
   \alpha_1 \arrow[r]
            \arrow[d, coily]
            \arrow[dr, densely dashed]
 & \alpha_2 \arrow[r, mdl]          \arrow[d, coily]
            \arrow[densely dashed, node on line'=west and east, dr, "dotted=dot" pic]
 & \alpha_k \arrow[trail off=right, "" {coordinate, at end, name=end2}]
            \arrow[d, coily]
            \arrow[densely dashed, from=dot.east]
\\
   \mu_1    \arrow[r]
            \arrow[ur, densely dashed]
 & \mu_2    \arrow[r, mdl]
            \arrow[densely dashed, to=dot.west]
 & \mu_k    \arrow[trail off=right, "" {coordinate, at end, name=end3}]
   \arrow[path only, from=end2, to=end3, "dotted=dot23" pic]
   \arrow[densely dashed, to=dot23.west]
   \arrow[densely dashed, from=2-3, to=dot23.west]
\\
   \tilde F_1 \arrow[u, densely dashed] \arrow[uu, curve left]
 & \tilde F_2 \arrow[u, densely dashed] \arrow[uu, curve left]
 & \tilde F_k \arrow[u, densely dashed] \arrow[uu, curve left]
\end{tikzcd}
\end{document}

Output

enter image description here

1
  • (+1) many thanks for writing the answer and adding explanatory comments. I have to familiarize myself with TikZ-CD. I wish I could accept two answers and not just one.
    – bmf
    Dec 7, 2022 at 12:47
4

What you want is a dash or dot pattern with relative placement. Dash or dot pattern : https://tikz.dev/tikz-actions#sec-15.3.2

You may add these lines at the end of your picture:

            \draw (posmuk)[dash pattern=on 20pt off 10pt]  -- +(3,0);
            \draw (posak) [dash pattern=on 20pt off 10pt] -- +(3,0);
            \end{tikzpicture}

Explanation:

I am asking tikz to draw a path -- (it could also be an edge) between the node named posmuk and a coordinate that is located +3x,0y away from posmuk

The dash pattern can be anything you like alternating between on and off: [dash pattern=on 2pt off 1pt on 40pt off 100pt].

It could also be dots.

If you extend this reasoning to every other node you want to draw, you may want to look at midway: https://tikz.dev/tikz-shapes#tikz/midway

or even at the calc library: https://tikz.dev/tikz-coordinates#tikz-lib-calc which provides a useful syntax:

($(nodeA)!0.5!(nodeB)$)

That will place a new node or coordinate on the average position of nodeA and nodeB.

2
  • Thanks. That was helpful, however, \draw (posmuk)[dash pattern=on 2pt off 1pt on 40pt of 100pt] -- +(3,0); leads to an error.
    – bmf
    Dec 7, 2022 at 10:49
  • I corrected the typo. Thank you.
    – anis
    Dec 7, 2022 at 11:34
4

While there are already some excellent answers from a brief glance that I had, I managed to get it done and I am sharing in case others find it useful. I want to say that my answer is not as good as the other ones.

The code is

\documentclass[12pt]{article}
\pdfoutput=1
\usepackage{mathtools}
\usepackage{float}
\usepackage{tikz, pgfplots}
\usetikzlibrary{arrows.meta, calc, positioning}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
\begin{figure}[H]
\begin{center}
\begin{tikzpicture}
[
node distance = 17mm and 31mm,
b/.style={rectangle, draw=black!60, fill=gray!15, very thick, minimum size=35},
c/.style={circle, draw=black!60, fill=gray!15, very thick, minimum size=35}
]

%Nodes
\node[b]      (posFk)                               {$F_k$};
\node[c]      (posak)      [below=of posFk]         {$\alpha_k$};
\node[c]      (posmuk)     [below=of posak]         {$\mu_k$};
\node[b]      (posFtk)     [below=of posmuk]      {$\tilde{F}_k$};

\node[b]      (posFF)      [left=of posFk]          {$F_2$};
\node[c]      (posakk)     [below=of posFF]         {$\alpha_2$};
\node[c]      (posmukk)    [below=of posakk]      {$\mu_2$};
\node[b]      (posFtkk)    [below=of posmukk]     {$\tilde{F}_2$};

\node[b]      (posFFF)     [left=of posFF]          {$F_1$};
\node[c]      (posakkk)    [below=of posFFF]        {$\alpha_1$};
\node[c]      (posmukkk)   [below=of posakkk]     {$\mu_1$};
\node[b]      (posFtkkk)   [below=of posmukkk]    {$\tilde{F}_1$};

%Curved lines for the quiver
\draw[-, very thick] (posmuk.east)  .. controls  +(right:17mm) and +(right:17mm)    .. (posFk.east);
\draw[-, very thick] (posak.west)       .. controls  +(left:17mm) and +(left:17mm)          .. (posFtk.west);
\draw[-, very thick] (posmukk.east)     .. controls  +(right:17mm) and +(right:17mm)    .. (posFF.east);
\draw[-, very thick] (posakk.west)  .. controls  +(left:17mm) and +(left:17mm)          .. (posFtkk.west);
\draw[-, very thick] (posmukkk.east)    .. controls  +(right:17mm) and +(right:17mm)    .. (posFFF.east);
\draw[-, very thick] (posakkk.west)     .. controls  +(left:17mm) and +(left:17mm)          .. (posFtkkk.west);

%Lines for each column of the quivers
%Right
\draw[-, very thick, dashed] (posFk.south)                                                          to node[right] {} (posak.north);
\draw[-, very thick, decorate,decoration={coil,aspect=0,segment length=5.9mm}] (posak.south)    to node[right] {} (posmuk.north);
\draw[-, very thick, dashed] (posmuk.south)                                                         to node[right] {} (posFtk.north);

%Middle
\draw[-, very thick, dashed] (posFF.south)                                                          to node[right] {} (posakk.north);
\draw[-, very thick, decorate,decoration={coil,aspect=0,segment length=5.9mm}] (posakk.south)   to node[right] {} (posmukk.north);
\draw[-, very thick, dashed] (posmukk.south)                                                    to node[right] {} (posFtkk.north);

%Left
\draw[-, very thick, dashed] (posFFF.south)                                                         to node[right] {} (posakkk.north);
\draw[-, very thick, decorate,decoration={coil,aspect=0,segment length=5.9mm}] (posakkk.south)  to node[right] {} (posmukkk.north);
\draw[-, very thick, dashed] (posmukkk.south)                                                   to node[right] {} (posFtkkk.north);

%Horizontal lines connecting the quiver
\draw[-, very thick] (posakkk.east)     to node[right] {} (posakk.west);
\draw[-, very thick] (posmukkk.east)  to node[right] {} (posmukk.west);

%Diagonal lines connecting the first part of the quiver
\draw[-, very thick, dashed] (posakkk.east)     to node[right] {} (posmukk.west);
\draw[-, very thick, dashed] (posmukkk.east)  to node[right] {} (posakk.west);

%Finishing off the middle part of the quiver
\node at (31mm,-43mm) (aux0) {$\bf\textcolor{black}{\ldots}$};
\draw[-, very thick, dashed] (posak) to node[right] {} (aux0.west);
\draw[-, very thick, dashed] (posmuk) to node[right] {} (aux0.west);

%Finishing off the straight lines
\node at (34mm,-29.5mm) (aux1) {$\bf\textcolor{black}{\ldots}$};
\node at (34mm,-58.5mm) (aux2) {$\bf\textcolor{black}{\ldots}$};
\draw[-, very thick]  (posak) to node[right] {} (aux1);
\draw[-, very thick] (posmuk) to node[right] {} (aux2);

%Connecting the middle part of the quiver diagram
\node at (-21mm,-43mm) (aux3) {$\bf\textcolor{black}{\ldots}$};
\draw[-, very thick, dashed] (posakk) to node[right] {} (aux3.west);
\draw[-, very thick, dashed] (posmukk) to node[right] {} (aux3.west);
\draw[-, very thick, dashed] (posak) to node[left] {} (aux3.east);
\draw[-, very thick, dashed] (posmuk) to node[left] {} (aux3.east);
\node at (-21mm,-29.5mm) (aux4) {$\bf\textcolor{black}{\ldots}$};
\draw[-, very thick] (posakk) to node[right] {} (aux4.west);
\draw[-, very thick] (posak) to node[left] {} (aux4.east);
\node at (-20mm,-59.5mm) (aux5) {$\bf\textcolor{black}{\ldots}$};
\draw[-, very thick] (posmukk) to node[right] {} (aux5.west);
\draw[-, very thick] (posmuk) to node[left] {} (aux5.east);

\end{tikzpicture}
\end{center}
\end{figure}
\end{document}

and the output

quiver

You must log in to answer this question.

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