在 TikZ 中格式化思维导图

在 TikZ 中格式化思维导图

我想知道是否有人可以帮助我格式化下面给出的思维导图,以便所有内容统一,并根据节点中的子节点数量设置角度?此外,我尝试缩放 TiZ 图片但仍然未能将其全部纳入边缘内。

    \documentclass{article}
    \usepackage{tikz}
    \usetikzlibrary{mindmap}
    \tikzset{level 1/.append style={sibling angle=50,level distance = 135mm}}
    \tikzset{level 2/.append style={sibling angle=20,level distance = 25mm}}
    \tikzset{every node/.append style={scale=0.5}}

    \begin{document}
    \pagestyle{empty}
    \begin{tikzpicture}[ mindmap, every node/.style=concept, concept color=teal!40,grow cyclic,]

    \node[concept] {Malnutrition}
    child [concept color=purple!40]{    node    {Health Facility}
            child { node    {Inadequate ANC Care} }
            child { node    {Long Distance of Health Care Facility} }
            child { node    {Insufficient Health Service} }
            child { node    {Incomplete Immunization} }
}
    child [concept color=pink!40]{ node     {Morbidity}
            child { node    {Intestinal Diseases} }
            child { node    {Congenital Anomalies} }
}
    child [concept color=green!40]{ node    {Maternal Health}
            child { node {Maternal malnutrition} }
            child { node {Higher Birth order} }
            child { node {Short birth interval} }
            child { node {Adolescent mother} }
}
    child [concept color=red!40]{ node  {Cultural Factors}
            child { node {Adverse cultural practice} }
            child { node {Traditional beliefs} }
            child { node {Early marriage} }
            child { node {Inadequate child care} }
            child { node {Feeding practices} } 
}  
    child [concept color=blue!40]{ node     {Socio-demographic Factors}
            child { node {Caste (ST/SC)} }
            child { node {Illiteracy} }
            child { node {Lack of Awareness about Nutrition} }
            child { node {Occupation} }
            child { node {Low Socio-Economic Status} } 
            child { node {Inadequate access to food} }    
}                                           
    child [concept color=yellow!40]{ node   {Biological Factors}[clockwise from=45, level distance=8cm]
            child { node {Female} }
            child { node {Low Birth Weight} }
            child { node {Age of the Child} }
}                                           
    child [concept color=violet!40]{ node {Environmental Factors}
            child { node {Poor Unsafe Drinking Water} }
            child { node {Poor Personal Hygiene} }
            child { node {Poor Sanitation} }
            child { node {Open Field Defecation} }
 };
\end{tikzpicture}
\end{document}

这就是结果

答案1

不幸的是,绘制思维导图似乎很麻烦。我喜欢结果。但它们似乎需要很多手动调整,如果你改变任何东西,你就必须重新编码一半的地图。如果forest只能绘制循环树...!

您可以缩放图片,如评论中所述。我倾向于“作弊”,让地图超出文本主体的宽度。通常,思维导图无论如何都需要放在自己的页面上,因此只要它们适合页面的物理尺寸,我倾向于让它们稍微超出边距。

或者,例如,您可以对外部节点使用较小的字体。

无论如何,这里 - 无论它有价值 - 是我尝试手动将地图挤压到它不想去的地方......

管理思维导图

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{mindmap}

\begin{document}
\pagestyle{empty}
{\centering
  \makebox[0pt]{%
    \begin{tikzpicture}
      [mindmap,
      grow cyclic,
      every node/.style=concept,
      concept color=teal!40,
      level 1/.append style={sibling angle=360/7},
      level 2/.append style={sibling angle=37.5},
      ]
      \node [root concept] {Malnutrition}
        child [concept color=purple!40]{
          node    {Health Facility}
          child { node    {Inadequate ANC Care} }
          child { node    {Long Distance of Health Care Facility} }
          child { node    {Insufficient Health Service} }
          child { node    {Incomplete Immunization} }
        }
        child [concept color=pink!40, rotate=-10]{
          node     {Morbidity}
          child { node    {Intestinal Diseases} }
          child { node    {Congenital Anomalies} }
        }
        child [concept color=green!40, rotate=-20]{
          node  {Maternal Health}
          child { node {Maternal malnutrition} }
          child { node {Higher Birth order} }
          child { node {Short birth interval} }
          child { node {Adolescent mother} }
        }
        child [concept color=red!40, rotate=-10]{
          node  {Cultural Factors}[counterclockwise from=-115]
          child  { node {Adverse cultural practice} }
          child { node {Traditional beliefs} }
          child { node {Early marriage} }
          child { node {Inadequate child care} }
          child { node {Feeding practices} }
        }
        child [concept color=blue!40, rotate=-7.5]{
          node     {Socio-demographic Factors}
          child { node {Caste (ST/SC)} }
          child { node {Illiteracy} }
          child { node {Lack of Awareness about Nutrition} }
          child { node {Occupation} }
          child { node {Low Socio-Economic Status} }
          child { node {Inadequate access to food} }
        }
        child [concept color=yellow!40, rotate=-5]{
          node   {Biological Factors}%[clockwise from=45, level distance=8cm]
          child { node {Female} }
          child { node {Low Birth Weight} }
          child { node {Age of the Child} }
        }
        child [concept color=violet!40, rotate=-5] {
          node {Environmental Factors}
          child { node {Poor Unsafe Drinking Water} }
          child { node {Poor Personal Hygiene} }
          child { node {Poor Sanitation} }
          child { node {Open Field Defecation} }
        };
  \end{tikzpicture}}\par}
\end{document}

相关内容