带文件系统分支的树形图

带文件系统分支的树形图

我正在尝试准确绘制此树形图:

在此处输入图片描述

我编辑了我的代码,它看起来更好,但仍然需要更多的工作。

以下是代码和结果:

\usetikzlibrary {trees}
\tikz [font=\footnotesize,grow=down, level 1/.style={->, sibling distance=20em},
,level 2/.style={->, sibling distance=8em}, level distance=3cm]

\node {Temporal Expressions}
   child { node {Tense}
      child { node {Past} }
      child { node {Present} }
      child { node {Future} }
  } ...

在此处输入图片描述

当我将以下代码与此选项一起传递给 {Aspect} 节点时:

 child [->, edge from parent fork down, sibling distance=30mm, level distance=30mm] { node {Aspect} ...

` 输出显示如下:

在此处输入图片描述

有什么修复建议吗?

答案1

这可以通过 来完成forest,但由于样式folder与标准样式的交互方式,它需要一些手动调整。

在此处输入图片描述

\documentclass{article}

\usepackage[edges]{forest}
\forestset{fold/.style={folder, grow'=0, s sep=0pt},
    arr/.style={edge=-latex}}

\begin{document}

\begin{forest}
    for tree={font=\footnotesize, parent anchor=south, child anchor=north}
    [LINGUISTIC TIME, s sep=1cm
        [TENSE, arr, for tree={fold}, before computing xy={s-=5mm}
            [Present]
            [Past]
            [Future]]
        [ASPECT, arr, l+=3.2mm, s sep=1cm
            [Grammatical, arr, for tree={fold}, before computing xy={s-=5mm}
                [Perfective]
                [Imperfective]
                [Progressive]]
            [Lexical, arr, l+=3.2mm, before computing xy={s-=5mm}
                [Atelic, forked edge, for tree={fold}, before computing xy={s-=5mm, l-=5mm}
                    [States]
                    [Activities]]
                [Telic, forked edge, for tree={fold}, before computing xy={s-=5mm, l-=5mm}
                    [Accomplishments]
                    [Achievements]]]]]
\end{forest}

\end{document}

答案2

  • 您的问题不清楚,抱歉。
  • 您可以使用forest包轻松绘制其他图像:

在此处输入图片描述

\documentclass[border=0.2 cm]{standalone}

\usepackage[edges]{forest}
\usetikzlibrary{arrows.meta}

\begin{document}
    \begin{forest}
for tree = 
{
    anchor = north,
    edge = {-Straight Barb, semithick},
    calign=edge midpoint,
    l sep = 7mm,
    s sep = 1mm,
}
[Temporal Expressions
    [TENSE
        [Present]
        [Past]
        [Futire]
    ]
    [ASPECT
        [grammatical
            [Perfective]
            [Imperfective]
            [Progressive]
        ]
        [Lexical
            [Atelic, 
                [States]
                [Activities]
            ]
            [Telic, 
                [Accomplishments]
                [Achievements]
            ]
        ]
    ]
]
\end{forest}
\end{document}

不幸的是,混合的树木风格并不简单(某些森林大师和包作者可能除外)绘制。

相关内容