tikz 包含所有学科和知识子学科的复杂思维导图

tikz 包含所有学科和知识子学科的复杂思维导图

我昨天才开始使用 LaTeX,但我被我非常雄心勃勃的所有学科知识图表难住了。问题(有些简单,有些可能更复杂):

  • 我可以更改页面大小以适合所有内容吗?
  • 我可以将主父节点置于中心吗?
  • 对于如此庞大的图表,有没有一种简单的方法可以利用兄弟角度?
  • 我还没有将所有节点添加到所有学科(但参见例如物理或逻辑节点,它们有这么多,我不知道如何对齐它们)
  • 最终,子学科之间的联系也会很好,但其庞大程度已经让人难以承受。

非常感谢任何帮助和建议!

这是我目前的代码:

     \documentclass[tikz] {standalone}
     \usetikzlibrary{mindmap}
     \usepackage[paperwidth=100cm,paperheight=100cm,hmargin=0cm,vmargin=0cm]{geometry}               
     \begin{document}
     \begin{tikzpicture}

     \path[mindmap, concept color=black, text=white,
       level 1 concept/.append style={level distance=52mm, sibling angle=100},
       level 2 concept/.append style={sibling angle=30},
       level 3 concept/.append style={sibling angle=20}]

     node[concept] {Disciplines}
     [clockwise from=0]
     child[concept color=blue] {
       node[concept] {Humanities}
       [clockwise from=120, level 2 concept/.append style={sibling angle=50}]
          child { node[concept] {Human History} }
          child { node[concept] {Linguistics} }
          child { node[concept] {Literature} }
          child { node[concept] {Arts} }
          child { node[concept] {Philosophy} }
          child { node[concept] {Religion} }
     }
     child[concept color=green!60!black] {
       node[concept] {Social Sciences}
       [clockwise from=0]
       child { node[concept] {Anthropology} }
       child { node[concept] {Archaeology} }
       child { node[concept] {Area studies} }
       child { node[concept] {Cultural and ethnic studies} }
       child { node[concept] {Economics} }
       child { node[concept] {Gender and sexuality studies} }
       child { node[concept] {Geography} }
       child { node[concept] {Political science} }
       child { node[concept] {Psychology} }
       child { node[concept] {Sociology} }
     }
     child[concept color=red] { 
       node[concept] { Natural Sciences} 
       [clockwise from=-110]
       child { node[concept] {Space sciences} }
       child { node[concept] {Earth sciences} }
       child { node[concept] {Biology} }
       child { node[concept] {Chemistry} }
       child { node[concept] {Physics} 
         [concept color=red!60]
         [clockwise from=30]
         child [grandchild] {node[concept] {Acoustics} }
         child [grandchild] {node[concept] {Applied Physics} }
         child [grandchild] {node[concept] {Astrophysics} }
         child [grandchild] {node[concept] {Atomic, molecular and optical physics} }
         child [grandchild] {node[concept] {Biophysics} }
         child [grandchild] {node[concept] {Computational physics} }
         child [grandchild] {node[concept] {Condensed matter physics} }
         child [grandchild] {node[concept] {Cryogenics} }
         child [grandchild] {node[concept] {Electromagnetism} }
         child [grandchild] {node[concept] {Elementary particle physics} }
         child [grandchild] {node[concept] {Fluid dynamics } }
         child [grandchild] {node[concept] {Geophysics} }
         child [grandchild] {node[concept] {Materials science} }
         child [grandchild] {node[concept] {Mathematical physics} }
         child [grandchild] {node[concept] {Medical physics} }
         child [grandchild] {node[concept] {Mechanics} }
         child [grandchild] {node[concept] {Molecular physics} }
         child [grandchild] {node[concept] {Newtonian physics} }
         child [grandchild] {node[concept] {Nuclear physics} }
         child [grandchild] {node[concept] {Optics} }
         child [grandchild] {node[concept] {Plasma physics} }
         child [grandchild] {node[concept] {Quantum physics} }
         child [grandchild] {node[concept] {Solid mechanics} }
         child [grandchild] {node[concept] {Solid state physics} }
         child [grandchild] {node[concept] {Statistical mechanics } }
         child [grandchild] {node[concept] {Theoretical physics} }
         child [grandchild] {node[concept] {Thermodynamics} }
         child [grandchild] {node[concept] {Vehicle dynamics} } }
     }
     child[concept color=orange] { 
       node[concept] { Formal Sciences} 
       [clockwise from=140]
       child { node[concept] {Logic} 
         [concept color=orange!60]
          child [grandchild] {node[concept] {Mathematical Logic} }
          child [grandchild] {node[concept] {Philosophical Logic} }
          child [grandchild] {node[concept] {Logic in Computer Science} } }
       child { node[concept] {Mathematics} 
         [concept color=orange!60]
          child [grandchild] {node[concept] {Algebra} }
          child [grandchild] {node[concept] {Analysis} }
          child [grandchild] {node[concept] {Probability theory} } 
          child [grandchild] {node[concept] {Geometry} }
          child [grandchild] {node[concept] {Number theory} }
          child [grandchild] {node[concept] {Logic and Foundations of mathematics} }
          child [grandchild] {node[concept] {Applied Mathematics} } }
       child { node[concept] {Statistics} }
       child { node[concept] {Systems science} }
     }
     child[concept color=gray] { 
       node[concept] { Applied Sciences and Professions} 
       [clockwise from=0]
       child { node[concept] {Agriculture} }
       child { node[concept] {Architecture and design} }
       child { node[concept] {Business} }
       child { node[concept] {Divinity} }
       child { node[concept] {Education} }
       child { node[concept] {Engineering} }
       child { node[concept] {Environmental studies and forestry} }
       child { node[concept] {Family and consumer sciences} }
       child { node[concept] {Healthcare science} }
       child { node[concept] {Human physical performance and recreation} }
       child { node[concept] {Journalism, media studies and communication} }
       child { node[concept] {Law} }
       child { node[concept] {Library and museum studies}}
       child { node[concept] {Military sciences} }
       child { node[concept] {Public administration} }
       child { node[concept] {Social work} }
       child { node[concept] {Transportation} }
     }


     \end{tikzpicture}
     \end{document}

再次感谢!

答案1

这是一个可能的解决方案。

在此处输入图片描述

Q1:更改页面大小以使其适合所有内容?

A1:在几何中正确设置paperwidth=xxcm和paperheight=xxcm。

Q2:将主父节点置于中心?

A2:(a) 正确设置 1 级概念/样式。在本例中,最外层的孙子级的applied science层级距离为 130 毫米,因此这是为 1 级样式设置的。另外,总共有 5 个子级,为了均匀辐射,兄弟级角度将是 360/5=72,这也是在 1 级中设置的。

(b)然而,对于第 2 级,子节点差异很大,因此该解决方案利用

set angles for level/.style={level 2/.append style={sibling angle=360/\the\tikznumberofchildren}},
level/.append style={set angles for level=2},

自动确定方向。

(c) 如果需要微调,请使用添加了选项scope的环境transform canvas,该选项可以上下移动整个思维导图。原点 (0,0) 始终位于 ,可通过提供的代码中的upper left corner设置进行检查。shift ={(0cm,0cm)}

Q3:对于如此庞大的图表,有没有简单的方法可以使用兄弟角度?

A3:如A2所述。

Q4:我还没有将所有节点添加到所有学科(但参见例如物理或逻辑节点,它们有这么多,我不知道如何对齐它们)

A4:增加level distance,使每个孙子节点进一步散开,形成一个更大的圆圈,以获得中间的空间。参见物理节点和应用科学节点的示例。

Q5:最终,子学科之间的联系也会很好,但其庞大程度已经让人难以承受

A5:给每个节点分配一个<内部名称>,然后使用draw命令连接这些节点。请参阅最后一行的一行示例。

代码

    \documentclass{article}%[tikz,border=10pt] {standalone}
    \usepackage{tikz}
     \usetikzlibrary{mindmap,calc}
    \usepackage[paperwidth=80cm,paperheight=60cm,showframe]{geometry}               

     \begin{document}
     \begin{tikzpicture}
     \begin{scope}[transform canvas={shift ={(30cm,-20cm)}}]%[transform canvas={shift={(1cm,1cm)}]
     \path[mindmap, concept color=black, text=white,
      level 1 concept/.append style={level distance=130mm, sibling angle=72},
      set angles for level/.style={level 2/.append style={sibling angle=360/\the\tikznumberofchildren}},
      level/.append style={set angles for level=2},
      level 3 concept/.append style={level distance=50mm, sibling angle=20},
      L1/.style={level distance=40mm},  % adjust level distance locally  when grandchildren increase
      L2/.style={level distance=60mm},  % adjust level distance locally  when grandchildren increase
]

     node[concept] {Disciplines}   % root node
     [clockwise from=0]
     child[concept color=blue] {node[concept] {Humanities}
       [clockwise from=30]         %, level 2 concept/.append style={sibling angle=50}]
          child { node[concept] {Human History} }
          child { node[concept] {Linguistics} }
          child { node[concept] {Literature} }
          child { node[concept] {Arts} }
          child { node[concept] {Philosophy} }
          child { node[concept] {Religion} }
     }
     child[concept color=green!60!black] {
       node[concept] {Social Sciences}
       [clockwise from=65]
       child[L1] { node[concept] {Anthropology} }
       child[L1] { node[concept] {Archaeology} }
       child[L1] { node[concept] {Area studies} }
       child[L1] { node[concept] {Cultural and ethnic studies} }
       child[L1] { node[concept] {Economics} }
       child[L1] { node[concept] {Gender and sexuality studies} }
       child[L1] { node[concept] {Geography} }
       child[L1] { node[concept] {Political science} }
       child[L1] { node[concept] {Psychology} }
       child[L1] { node[concept] {Sociology} }
     }
     child[concept color=red] {           % extend the arm of natural science 
       node[concept] { Natural Sciences} 
       [clockwise from=90]
       child { node[concept] {Space sciences} }
       child { node[concept] {Earth sciences} }
       child { node[concept] {Biology} }
       child { node[concept] {Chemistry} }
       child[level distance=100mm] { node[concept] {Physics} % extend the arm of physics
         [concept color=red!60,]
         [clockwise from=30]
         child {node[concept] {Acoustics} }
         child {node[concept] {Applied Physics} }
         child {node[concept] {Astrophysics} }
         child {node[concept] {Atomic, molecular and optical physics} }
         child {node[concept] {Biophysics} }
         child {node[concept] {Computational physics} }
         child {node[concept] {Condensed matter physics} }
         child {node[concept] {Cryogenics} }
         child {node[concept] {Electromagnetism} }
         child {node[concept] {Elementary particle physics} }
         child {node[concept] {Fluid dynamics } }
         child {node[concept] {Geophysics} }
         child {node[concept] {Materials science} }
         child {node[concept] {Mathematical physics} }
         child {node[concept] {Medical physics} }
         child {node[concept] {Mechanics} }
         child {node[concept] {Molecular physics} }
         child {node[concept] {Newtonian physics} }
         child {node[concept] {Nuclear physics} }
         child {node[concept] {Optics} }
         child {node[concept] {Plasma physics} }
         child {node[concept] {Quantum physics} }
         child {node[concept] {Solid mechanics} }
         child {node[concept] {Solid state physics} }
         child {node[concept] {Statistical mechanics } }
         child {node[concept] {Theoretical physics} }
         child {node[concept] {Thermodynamics} }
         child {node[concept] {Vehicle dynamics} } }
     }
     child[concept color=orange] { 
       node[concept] { Formal Sciences} 
       [clockwise from=200]
       child { node[concept] {Logic} 
         [concept color=orange!60]
          child [] {node[concept] {Mathematical Logic} }
          child [] {node[concept] {Philosophical Logic} }
          child [] {node[concept] {Logic in Computer Science} } 
               }
       child { node[concept] {Mathematics} 
         [concept color=orange!60]
          child [] {node[concept] {Algebra} }
          child [] {node[concept] {Analysis} }
          child [] {node[concept] {Probability theory} } 
          child [] {node[concept] {Geometry} }
          child [] {node[concept] {Number theory} }
          child [] {node[concept] {Logic and Foundations of mathematics} }
          child [] {node[concept] (a) {Applied Mathematics} } 
              }
       child { node[concept] {Statistics} }
       child { node[concept] {Systems science} }
     }
     child[concept color=gray] { 
       node[concept] { Applied Sciences and Professions} 
       [clockwise from=8]
       child[L2] { node[concept] {Agriculture} }
       child[L2] { node[concept] {Architecture and design} }
       child[L2] { node[concept] {Business} }
       child[L2] { node[concept] {Divinity} }
       child[L2] { node[concept] {Education} }
       child[L2] { node[concept] {Engineering} }
       child[L2] { node[concept] {Environmental studies and forestry} }
       child[L2] { node[concept] {Family and consumer sciences} }
       child[L2] { node[concept] {Healthcare science} }
       child[L2] { node[concept] (b) {Human physical performance and recreation} }
       child[L2] { node[concept] {Journalism, media studies and communication} }
       child[L2] { node[concept] {Law} }
       child[L2] { node[concept] {Library and museum studies}}
       child[L2] { node[concept] {Military sciences} }
       child[L2] { node[concept] {Public administration} }
       child[L2] { node[concept] {Social work} }
       child[L2] { node[concept] {Transportation} }
};
\draw[red,thick,->] (a) -- node[midway]{some text} (b);
     \end{scope}
     \end{tikzpicture}

     \end{document}

相关内容