使用 tikzpicture 创建图形来表示序数

使用 tikzpicture 创建图形来表示序数

我正在背面我想制作一个图表以以下方式表示序数(数学术语)...

在此处输入图片描述

我正在用tikzpicture它制作这个图表。我的尝试如下(未完成!)。

\begin{tikzpicture}
  \draw[gray] (-4,-4) grid (4,4);
  \draw (0,0) node[] {$0$};
  \draw (-0.3,-0.2) node[] {$1$};
  \draw (-0.5,-0.4) node[] {$2$};
  \draw (-0.4,-0.7) node[] {$3$};
  \draw[-> , dotted]  (-0.3,-0.8) .. controls (0.2,-1.2) and (1,-0.3) .. (0.3,0.4) ;
  \draw (0,0.5) node[] {$\omega$};
  \draw (-0.8,0.3) node[] {$\omega+1$};
  \draw (-1.3,-0.3) node[] {$\omega+2$};
  \draw (-1.1,-0.8) node[] {$\omega+3$};
  \draw[-> , dotted]  (-1,-1) .. controls (-0.9,-1.3) and (-0.6,-1.5) .. (-0.35,-1.5) ;
  \draw (0,-1.5) node[] {$2 \cdot \omega$};
  \draw[-> , dotted]  (.55,-1.5) .. controls (1.2,-1.3) and (1.3,-0.8) .. (1.3,-0.5) ;
  \draw (1.3,-0.3) node[] {$3 \cdot \omega$};
  \draw[-> , dotted]  (1.3,0) .. controls (1.3,0.5) and (1,1.3) .. (0.3,1.3) ;
  \draw (0,1.3) node[] {$\omega^{\omega}$};
\end{tikzpicture}

其输出如下

在此处输入图片描述

但问题是,这非常耗时,而且看起来不太美观。此外,像 $\omega + 1、\omega + 2$ 等条目在这张图片中感觉太大了。我们可以缩小尺寸吗?有人能告诉我创建此类图表的其他方法吗?有任何链接可以检查吗?或者有人提供任何来源吗?任何形式的帮助都会非常有帮助。

注意:我特意使用网格来相应地绘制条目。我说的漂亮,不是指网格,我可以评论那一行。

提前致谢。

答案1

我发现这是一个有趣的挑战,因为它是关于将术语放置在类似于螺旋的东西中,搜索我发现这非常详细代码来自 Guilherme Zanotelli绘制参数螺旋,然后我对其进行了调整以获得类似的结果,我使用了一些嵌套来放置节点。

结果:

在此处输入图片描述

梅威瑟:

\documentclass[tikz,border=0.5cm]{standalone}

%this code is from Guilherme Zanotelli  in a "short" explanation in https://tex.stackexchange.com/a/333824/154390 [start]
\newcommand\bonusspiral{} % just for safety
% \bonusspiral[draw options](placement)(start angle:end angle)(start radius:final radius)[revolutions]
\def\bonusspiral[#1](#2)(#3:#4)(#5:#6)[#7]{
    \pgfmathsetmacro{\domain}{#4+#7*360}
    \pgfmathsetmacro{\growth}{180*(#6-#5)/(pi*(\domain-#3))}
    \draw [#1,
    shift={(#2)},
    domain=#3*pi/180:\domain*pi/180,
    variable=\t,
    smooth,
    samples=int(\domain/5)] plot ({\t r}: {#5+\growth*\t-\growth*#3*pi/180});
}
%this code is from Guilherme Zanotelli  in a "short" explanation in https://tex.stackexchange.com/a/333824/154390 [end]

%Modification to put a node in specific point of the function
%\NodeOnSpiral[draw options](placement)(start angle:end angle)(start radius:final radius)[revolutions]{node_position_in_degrees}{node content}
\def\NodeOnSpiral[#1](#2)(#3:#4)(#5:#6)[#7]#8#9{
    \pgfmathsetmacro{\dom}{#4+#7*360}
    \pgfmathsetmacro{\grow}{180*(#6-#5)/(pi*(\dom-#3))}
    \path [
        shift={(#2)},
        domain=#3*pi/180:\dom*pi/180,
        variable=\j,
        smooth,
        samples=int(\dom/5),
        samples at=#8*pi/180
    ]
        plot ({\j r}: {#5+\grow*\j-\grow*#3*pi/180})
        node[
            #1,
            rectangle,
            fill=white,
            inner sep=2pt,
            scale=0.8
        ]{#9};
}

\begin{document}
    \begin{tikzpicture}[>=latex]
    %Start drawing the thing.
    % First spiral is used as workspace a spiral that starst from 90 at radious 1 and ends at 90 at radious 6.
    \bonusspiral[black!10,dotted, thick](0,0)(90:90)(1:6)[5]
    
    % Draw a line from (90:1) to (90:6)
    \draw[thick] (90:1) -- (90:4);
    \draw[thick,dashed] (90:4) -- (90:6);
    
    % Draw the first spiral arrow in one revolution from 90:1 to 85:2. no to 90:2 to not put the arrow interrupting the node
    \bonusspiral[red!50!black,dashed, thick,->](0,0)(90:85)(1:2)[1]
    % Put the nodes in their corresponding angle position in the spiral.
    \foreach  \degpos/\nodetext in {
        90/0,
        135/1,
        180/2,
        225/3%
    }{\NodeOnSpiral[green!50!black](0,0)(90:90)(1:3)[2]{\degpos}{$\nodetext$}}

    % Draw the second spiral arrow in one revolution from 90:2 to 85:3. 
    \bonusspiral[blue!50!black,dashed, thick,->](0,0)(90:86)(2:3)[1]
    % same thing in the corresponding spiral and revolution angle.
    \foreach  \degpos/\nodetext in {
        450/w,
        480/w+1,
        510/w+2,
        630/2w,
        660/2w+1,
        690/2w+2,
        720/3w,
        760/4w%
    }{\NodeOnSpiral[red!50!black](0,0)(90:90)(1:3)[2]{\degpos}{$\nodetext$}}

    % Draw the third spiral arrow in one revolution from 90:3 to 85:4. 
    \bonusspiral[blue!50!black,dashed, thick,->](0,0)(90:87)(3:4)[1]
    % same thing in the corresponding spiral and revolution angle.
    \foreach  \degpos/\nodetext in {
        810/w^2,
        840/w^2+1,
        870/w^2+2,
        945/w^2+w,
        990/w^2+dw,
        1035/w^2\cdot2,
        1080/w^2\cdot3%
    }{\NodeOnSpiral[red!50!black](0,0)(90:90)(1:3)[2]{\degpos}{$\nodetext$}}

    % Draw the last spirals arrow in two revolutions from 95:4 to 88:6. 
    \bonusspiral[black, thick](0,0)(93:87)(4:5)[1]
    \bonusspiral[black, thick,->](0,0)(93:88)(5:6)[1]
    % same thing in the corresponding spiral and revolution angle.
    \foreach  \degpos/\nodetext in {
        1170/w^3,
        1890/w^w%
    }{\NodeOnSpiral[red!50!black](0,0)(90:90)(1:3)[2]{\degpos}{$\nodetext$}}

    
    \end{tikzpicture} 
\end{document}

相关内容