思维导图和树:第三级节点的边长和围绕根节点的旋转

思维导图和树:第三级节点的边长和围绕根节点的旋转

问题 1

我想让到蓝色节点的边更长,我只是真的希望能够修改,并且我尝试了 stackexchange 上的十亿种方法(从改变 paperheight 到添加 level 2 和 level3 concept/.append 样式以及各种不同级别的距离和内部分离)但没有任何帮助:

\PassOptionsToPackage{table}{xcolor}
\documentclass{article}
\usepackage{tikz,times}
\usepackage[paperwidth=30cm,paperheight=50cm,right=.5cm,top=10cm] 
{geometry} 

\usetikzlibrary{mindmap,trees}

 \definecolor{mypink3}{cmyk}{0, 0.7808, 0.4429, 0.1412}
 \definecolor{yel}{rgb}{0.898, 0.6196, 0.14}
 \definecolor{blue1}{rgb}{0.11, 0.5, 0.9}

\pagestyle{empty}

\begin{document}


\begin{tikzpicture}[mindmap,every node/.append style={font=\large},
   level 1 concept/.append style={level distance=230,sibling angle=30}] 


 \node [concept, ball color=yel!90!black,  inner sep=50] (Central) 
{Central}[counterclockwise from=90] 

     child {node [concept, ball color=mypink3!90!black, inner sep=10] 
(Leymebamba) {Leymebamba}
            child[grow=75] {node [concept, ball color=blue1!90!black, inner sep=5] (Pacasmayo) {Pacasmayo}} 
            child[grow=75, clockwise from=45] {node [concept, ball color=blue1!90!black, inner sep=5] (Huari) {Huari}} 
             }
     child {node [concept, ball color=mypink3!90!black, inner sep=10] (Chancay) {Chancay}
            child{node [concept, ball color=blue1!90!black, inner sep=5] (Huacho) {Huacho}}
            };


  \path 
    (Central) to[circle connection bar switch color=from (yel!90!black) to (mypink3!90!black)] (Leymebamba);
             \path 
            (Leymebamba) to[circle connection bar switch color=from (mypink3!90!black) to (blue1!90!black)] (Pacasmayo);
             \path 
            (Leymebamba) to[circle connection bar switch color=from (mypink3!90!black) to (blue1!90!black)] (Huari);
\path 
    (Central) to[circle connection bar switch color=from (yel!90!black) to (mypink3!90!black)] (Chancay);

 \path 
       (Chancay) to[circle connection bar switch color=from 
(mypink3!90!black) to (blue1!90!black)] (Huacho);
    \end{tikzpicture}

\end{document}

生成了如下图片:

在此处输入图片描述

谢谢你!

问题2

我想放置另外 5 个红色节点(称为 2 级?),并且我只想将所有东西都放在圆圈的左侧,使用思维导图示例这个 Stackoverflow 问题,这里基本上就是我希望它看起来的样子,我如何使用上面的思维导图来实现这一点(尝试改变兄弟角度、旋转起点,例如“从=90逆时针旋转”但没有任何效果,它一直旋转 360 度:

在此处输入图片描述

答案1

您的代码中的关键问题是您没有将思维导图构建为单一路径,而是尝试应用于mindmaptikzpicture此外,除非您需要非标准边缘(这里不需要),否则您不需要手动绘制连接。

以下代码说明了问题 1 中提出的问题的解决方案。根据每个问题一个问题的规则,问题 2 应该是一个新问题。

\documentclass[border=10pt]{standalone}
\usepackage{tikz,tgtermes}% times is deprecated - use one of the other options
\usetikzlibrary{mindmap,trees}
\definecolor{mypink3}{cmyk}{0, 0.7808, 0.4429, 0.1412}
\definecolor{yel}{rgb}{0.898, 0.6196, 0.14}
\definecolor{blue1}{rgb}{0.11, 0.5, 0.9}

\begin{document}
\begin{tikzpicture} 
  \path [
    mindmap,
    every node/.append style={text=white},
    level 1 concept/.append style={level distance=230, sibling angle=30, font=\large\sffamily\bfseries},
    level 2 concept/.append style={level distance=100, sibling angle=30, font=\sffamily\bfseries},
    concept color=yel!90!black,
  ]
  node [concept, font=\Huge\sffamily\bfseries, ball color=yel!90!black,  inner sep=50] (Central) {Central}[counterclockwise from=90] 

  child [concept color=mypink3!90!black] {
    node [concept, inner sep=10, ball color=mypink3!90!black] (Leymebamba) {Leymebamba}
    child[grow=75, concept color=blue1!90!black] {
      node [concept,  inner sep=5, ball color=blue1!90!black] (Pacasmayo) {Pacasmayo}
    } 
    child [grow=75, clockwise from=45, concept color=blue1!90!black ] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huari) {Huari}
    }
  }
  child [concept color=mypink3!90!black] {
    node [concept,  inner sep=10, ball color=mypink3!90!black] (Chancay) {Chancay}
    child [concept color=blue1!90!black] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huacho) {Huacho}
    }
  };
\end{tikzpicture}
\end{document}

这是真正的思维导图,而不仅仅是使用库提供的一些样式:请注意,mindmap作为选项传递给整体\path,并且第一个节点是此路径的一部分,即所有内容都在路径的范围内mindmap。您无需将其传递给整个图片,这样做也没有任何好处。

一旦正确设置,不同级别的样式就会按预期工作,连接器会自动绘制,一切开始步入正轨......

真正的思维导图


虽然它不应该在这里……

\documentclass[border=10pt]{standalone}
\usepackage{tikz,tgtermes}% times is deprecated - use one of the other options
\usetikzlibrary{mindmap,trees}
\definecolor{mypink3}{cmyk}{0, 0.7808, 0.4429, 0.1412}
\definecolor{yel}{rgb}{0.898, 0.6196, 0.14}
\definecolor{blue1}{rgb}{0.11, 0.5, 0.9}

\begin{document}
\begin{tikzpicture} 
  \path [
    mindmap,
    every node/.append style={text=white},
    level 1 concept/.append style={level distance=230, sibling angle=30, font=\large\sffamily\bfseries},
    level 2 concept/.append style={level distance=100, font=\sffamily\bfseries},
    concept color=yel!90!black,
  ]
  node [concept, font=\Huge\sffamily\bfseries, ball color=yel!90!black,  inner sep=50] (Central) {Central}[counterclockwise from=90] 

  child [concept color=mypink3!90!black] {
    node [concept, inner sep=10, ball color=mypink3!90!black] (Leymebamba) {Leymebamba}
    child[grow=75, concept color=blue1!90!black] {
      node [concept,  inner sep=5, ball color=blue1!90!black] (Pacasmayo) {Pacasmayo}
    } 
    child [grow=75, clockwise from=45, concept color=blue1!90!black ] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huari) {Huari}
    }
  }
  child [concept color=mypink3!90!black] {
    node [concept,  inner sep=10, ball color=mypink3!90!black] (Chancay) {Chancay}
    child [concept color=blue1!90!black] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huacho) {Huacho}
    }
  }
  child [concept color=mypink3!90!black] {
    node [concept,  inner sep=10, ball color=mypink3!90!black] (Chancay) {Chancay}
    child [concept color=blue1!90!black, grow=120] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huacho) {Huacho}
    }
  }
  child [concept color=mypink3!90!black] {
    node [concept,  inner sep=10, ball color=mypink3!90!black] (Chancay) {Chancay}
    [counterclockwise from=180]
    child [concept color=blue1!90!black] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huacho) {Huacho}
    }
  }
  child [concept color=mypink3!90!black] {
    node [concept,  inner sep=10, ball color=mypink3!90!black] (Chancay) {Chancay}
    child [concept color=blue1!90!black, grow=-120] {
      node [concept, inner sep=5, ball color=blue1!90!black] (Huacho) {Huacho}
    }
  }
  ;
\end{tikzpicture}
\end{document}

放置节点的各种方式

相关内容