思维导图级别特定子距离

思维导图级别特定子距离

使用我得到的答案这个问题,我有一个思维导图,里面有 6 个子项,每个子项又有 2-5 个自己的子项。

梅威瑟:

% Author: Till Tantau
% Source: The PGF/TikZ manual
\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{mindmap,trees}

\begin{document}
\resizebox{!}{4 in}{%
   \begin{tikzpicture}
      \path[
         mindmap,
         concept color=black,
         text=white,
         grow cyclic,
         segment length=20cm
      ]
      node[concept] {Main}
      [clockwise from=0]
      child[concept color=green!50!black] {%
         node[concept] {A}
         [clockwise from=65]
         child {node[concept] {A1} }
         child {node[concept] {A2} }
         child {node[concept] {A3} }
      }  
      child[concept color=blue] {%
         node[concept] {B}
         [clockwise from=-20]
         child {node[concept] {B2} }
         child {node[concept] {B3} }
      }
      child[concept color=red] {%
         node[concept] {C}
         [clockwise from=5]
         child {node[concept] {C1} }
         child {node[concept] {C2} }
         child {node[concept] {C3} }
         child {node[concept] {C4} }
         child {node[concept] {C5} }
      }
      child[concept color=orange] {%
         node[concept] {D}
         [clockwise from=-145]
         child {node[concept] {D1} }
         child {node[concept] {D2} }
      }
      child[concept color=magenta] {%
         node[concept] {E}
         [clockwise from=-180]
         child {node[concept] {E1} }
         child {node[concept] {E2} }
         child {node[concept] {E3} }
      }
      child[concept color=brown] {%
         node[concept] {F}
         [clockwise from=-245]
         child {node[concept] {F1} }
         child {node[concept] {F2} }
         child {node[concept] {F3} }
         child {node[concept] {F4} }
      };
   \end{tikzpicture}
}
\end{document}

输出:

在此处输入图片描述

问题: 我需要 1 级子节点 ( A- F) 离父节点 () 更远一些,MAIN因为即使现在,也F离 太近A并且F3与 重叠A1。此外,如果我希望每个 1 级子节点都有 5 或 6 个自己的子节点,那么就会出现严重的重叠。我该如何增加每个子节点/节点或至少每个级别的兄弟节点距离。

答案1

您可以在里面使用level distance=<length>和/或来自定义特定级别的距离和角度。完整示例:sibling angle=<value>level <number>/.append style

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

\begin{document}
\resizebox{!}{4 in}{%
   \begin{tikzpicture}
      \path[
         mindmap,
         concept color=black,
         text=white,
         grow cyclic,
         segment length=20cm,
level 1/.append style={level distance=8cm,sibling angle=60},
level 2/.append style={level distance=2.5cm},
      ]
      node[concept] {Main}
      [clockwise from=0]
      child[concept color=green!50!black] {%
         node[concept] {A}
         [clockwise from=30]
         child {node[concept] {A1} }
         child {node[concept] {A2} }
         child {node[concept] {A3} }
         child {node[concept] {A4} }
         child {node[concept] {A5} }
         child {node[concept] {A6} }
      }  
      child[concept color=blue] {%
         node[concept] {B}
         [clockwise from=30]
         child {node[concept] {B1} }
         child {node[concept] {B2} }
         child {node[concept] {B3} }
         child {node[concept] {B4} }
         child {node[concept] {B5} }
         child {node[concept] {B6} }
      }
      child[concept color=red] {%
         node[concept] {C}
         [clockwise from=30]
         child {node[concept] {C1} }
         child {node[concept] {C2} }
         child {node[concept] {C3} }
         child {node[concept] {C4} }
         child {node[concept] {C5} }
         child {node[concept] {C6} }
      }
      child[concept color=orange] {%
         node[concept] {D}
         [clockwise from=30]
         child {node[concept] {D1} }
         child {node[concept] {D2} }
         child {node[concept] {D3} }
         child {node[concept] {D4} }
         child {node[concept] {D5} }
         child {node[concept] {D6} }
      }
      child[concept color=magenta] {%
         node[concept] {E}
         [clockwise from=30]
         child {node[concept] {E1} }
         child {node[concept] {E2} }
         child {node[concept] {E3} }
         child {node[concept] {E4} }
         child {node[concept] {E5} }
         child {node[concept] {E6} }
      }
      child[concept color=brown] {%
         node[concept] {F}
         [clockwise from=30]
         child {node[concept] {F1} }
         child {node[concept] {F2} }
         child {node[concept] {F3} }
         child {node[concept] {F4} }
         child {node[concept] {F5} }
         child {node[concept] {F6} }
      };
   \end{tikzpicture}
}
\end{document}

在此处输入图片描述

相关内容