如何绘制雅可比/弦图

如何绘制雅可比/弦图

在此处输入图片描述我想绘制雅可比/弦图(https://arxiv.org/pdf/1912.10425.pdf),但我不知道如何绘制它们。任何帮助都值得感激。

答案1

文章的源代码可以在 arXiv 上找到https://arxiv.org/format/1912.10425并且它使用 TikZ 来绘制图表。这意味着您不需要知道如何绘制此类图表,因为您只需查找如何创建图表即可。

例如右上角的那个:

\documentclass{standalone}
\usepackage{tikz}

\definecolor{orangeii}{RGB}{240,90, 10}
\definecolor{darkblue}{rgb}{0.05,0.25,0.65}

\begin{document}

    
\begin{tikzpicture}

  \begin{scope}

  \clip (0,0) circle (2);

  \draw[draw=orangeii, fill=orangeii] (90+120-30:2) circle (.07);
  \draw[draw=orangeii, fill=orangeii] (90+360-30:2) circle (.07);
  \draw[thick, orangeii] (90+120-30:2) to[bend right=19] (90+360-30:2);

  \draw[draw=orangeii, fill=orangeii] (90+240-60:2) circle (.07);
  \draw[draw=orangeii, fill=orangeii] (90+360-60:2) circle (.07);
  \draw[thick, orangeii] (90+240-60:2) to[bend left=19] (90+360-60:2);

  \draw[draw=white, fill=white] (90+60:.79) circle (.07);

  \draw[draw=orangeii, fill=orangeii] (90+120-90:2) circle (.07);
  \draw[draw=orangeii, fill=orangeii] (90+240-90:2) circle (.07);
  \draw[thick, orangeii] (90+120-90:2) to[bend left=19] (90+240-90:2);

  \end{scope}

  \draw[darkblue, ultra thick] (0+2+90:2) arc (0+90+2:90+120-2:2);
  \draw[darkblue, ultra thick] (90+120+2:2) arc (90+120+2:90+240-2:2);
  \draw[darkblue, ultra thick] (90+240+2:2) arc (90+240+2:90+360-2:2);

  \draw (90+120-10:2.25) node {\tiny $1$};
  \draw (90+240-10:2.25) node {\tiny $2$};
  \draw (90+360-10:2.25) node {\tiny $3$};

  \draw[->] (90+90-10+212:2.3) arc (90+90-10+212:90+110-10+212:2.3);

\end{tikzpicture}

\end{document}

在此处输入图片描述

答案2

这应该可以让你开始。首先clip画外圆,然后从后向前画弦,使用double样式来产生跳过先前绘制的弦的效果。使用极坐标(θ:r)作为端点。使用bend left=<angle>bend right=<angle>作为弦。你也可以使用to[out=<angle>, in=<angle>]

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\colorlet{chordcolor}{orange}
\colorlet{arccolor}{blue}

\tikzset{
    dot/.style={circle, fill=chordcolor, inner sep=0pt, minimum size=4pt},
    chord/.style={
        white, line width=1pt, double=orange, double distance=.6pt, 
        decoration={markings, mark=between positions 0 and 1 step .999 with 
        {\node[dot]{};}},
        postaction=decorate
    },
    Jacobi/.style={line width=2pt, arccolor}
}

\begin{document}
\begin{tikzpicture}[scale=2]

% clip outer circle to prevent drawing of full dots on circle 
\clip (0,0) circle[radius=1cm];

% draw two chords and name coordinates for edges 
\draw[chord](150:1) to[bend left]coordinate[pos=.4](A) (260:1);
\draw[chord](170:1) to[bend right=15]coordinate[pos=.4](B) (60:1);

% draw edge
\draw[chord] (A) to[bend right=10] (B);

% draw chord and name coordinate 
\draw[chord](290:1) to[bend left=60]coordinate[pos=.4](C) (320:1);

% make a path to locate position of internal vertex, then draw internal chord
\path(10:1) to[bend left=15]coordinate[pos=.2](D) (130:1);
\draw[chord, looseness=1.5] (C) to[out=120, in=120] (D);

% draw chord "on top" with dot at appropriate position
\draw[chord](10:1) to[bend left=15]node[dot, pos=.2]{} (130:1);

% draw chord
\draw[chord](235:1) to[bend left=15] (-5:1);

% draw circle
\draw[Jacobi] (0,0) circle[radius=1cm];

\end{tikzpicture}
\end{document}

相关内容